DOS Batch : remove characters from string in a FOR loop
问题 I have a TXT file that contains : C086002-B3116 C086014-T1234 C086014-T1325 C086014-T1375" C086014-T1374" These strings include both trailing whitespaces and double quotes. I want to remove these using a FOR loop : for /f %%a in (file.txt) do ( set str=%%a set str=%str: =% set str=%str:"=% ) The Shell windows is opening and closing down immediately and nothing is done on the strings... Thanks for your help on this operation. 回答1: You have to activate the delayed expansion for multiple change