Posts

Showing posts from December 20, 2018

How to change a registry value with a variable in path?

Image
-4 0 I'd like to change the value "vbawarnings" but the registry path has the word version in it (15.0 or 16.0 or something). So I don't know which word version is insalled on the 5000 computer in our company. I tried this but something went wrong with %%~fA @echo off setlocal set key=HKEY_CURRENT_USERSoftwareMicrosoftOffice for /f %%A in ('reg query "%key%"') do ( reg add "%key%%%~fAwordsecurity" /t REG_DWORD /v vbawarnings /d 1 /f ) Any Ideas? Thank you very much :) windows microsoft-word windows-registry share | improve this question edited Nov 30 at 11:29

sed or awk: remove numbers after a symbol

Image
4 I would like to remove just the numbers and "_" after ">" symbol, for example: >1_CR-B_CR56_t MTKIIKFVYFMTIFISPNHHCPVYNCTHPKQPWCKLVRLQLLFHGSLIGLCDCI >2_R-B_R46_t MVEVTKLVNVMLIFLTLSPLVYDCQAYECELPFKPDCLMVEYSPQFVALRCGCV >3000_N-N274_M MVEVTKLVNVMLIFLTLFVYTDSDCQAYACELPFKPDCLMVEYAPQFFRLACGCV Expected Results: >CR-B_CR56_t MTKIIKFVYFMTIFISPNHHCPVYNCTHPKQPWCKLVRLQLLFHGSLIGLCDCI >R-B_R46_t MVEVTKLVNVMLIFLTLSPLVYDCQAYECELPFKPDCLMVEYSPQFVALRCGCV >N-N274_M MVEVTKLVNVMLIFLTLFVYTDSDCQAYACELPFKPDCLMVEYAPQFFRLACGCV I used sed "s/>[0-9][_]//g" but it removed ">" as well. awk sed delete share | improve this question