Batch loop and check if string contains

February 24, 2011 at 03:54:33
Specs: Windows 7
I have a script where I loop through a file, take the file and put it into a variable to it appears as one line and then assign that one line to a new variable. This works great with:

(for /f "delims=" %%a in (temp.txt) do set/p=%%a ) <nul >newfile.txt
For /f "delims=" %%a in (newfile.txt) Do Set MyVar=%%a

However I want to check that if a line in temp.txt starts with --, it is ignored and not copied into newfile.txt. Any ideas? :)


See More: Batch loop and check if string contains

Report •

#1
February 24, 2011 at 04:23:27
Solved it with an eol - thanks anyway

Report •
Related Solutions


Ask Question