.Bat to remove columns or remove text in a csv file -
i have created below .bat file @ programs installed on pc.
cd c:\users\%username%\documents reg query "hklm\software\microsoft\windows\currentversion\uninstall" /s | findstr /b ".*displayname" >%username%.csv reg query "hklm\software\wow6432node\microsoft\windows\currentversion\uninstall" /s | findstr /b ".*displayname" >>%username%.csv
however on output want name of program shown. @ moment output is:
displayname reg_sz microsoft office excel mui (english) 2010
i want somehow have output “microsoft office excel mui (english) 2010” remove “ displayname reg_sz “ rows of data contain word “reg_sz”.
any great.
thank you
john
you can way:
@echo off cd c:\users\%username%\documents type nul > %username%.csv /f "tokens=1,2*" %%a in ('reg query "hklm\software\microsoft\windows\currentversion\uninstall" /s ^| findstr /b ".*displayname"') ( echo %%c >> %username%.csv ) /f "tokens=1,2*" %%a in ('reg query "hklm\software\wow6432node\microsoft\windows\currentversion\uninstall" /s ^| findstr /b ".*displayname"') ( echo %%c >> %username%.csv )
Comments
Post a Comment