Need to split up a file into multiple files using DOS commands
I have a txt file with lines delimited by < and >. Each line begins with < and ends with > (quotes not included in the file).
I need to split up each line within these tags to a new file using DOS commands. There are different symbols like | and spaces in each line which should be ignored.
Only beginning < and ending > should be taken into account for creating new files.
How can this be done?
Following code should do it. File name may also be extracted from line content.
setlocal enabledelayedexpansion set IDX=1 for /f "delims=<> tokens=1" %%L in (myfile.txt) do ( echo %%L>file!IDX!.bat set /A IDX+=1 )