|Hi, I'm reading an input xml file and it has many comment lines in the form of:|
<!-- This is a comment -->
I'm doing some manipulations with the tags with no problem, but when I echo the lines to a new file, my comment lines are missing the ! character - so they show up in the new file as follows:
<-- This is a comment -->
I have no idea why this happening. How do I correct this?
Here is my code:
::preserve blank lines using FINDSTR, assume no line starts with :
for /f "tokens=1* delims=:" %%A in ('type "%inputFile%" ^| findstr /n "^"') do (
... other code here ...
... Howver Comment lines are simply read and echoed back to outputFile
if "%%B"=="" (echo. >>"%outputFile%") else (echo.%%B>>"%outputFile%")
message edited by Iyes