Making one row of results with a batch file?



I have this batch script im working on, the point is to extract certain information from an XML and output the results in a text file. I am able to make it work however, I would like my results to come out in rows.



@echo off
setlocal EnableDelayedExpansion

(for /F "delims=" %%a in ('findstr /I /L "<XOrigin> <YOrigin> <XExtent> <YExtent>" grid_crawler_output.xml') do (
set "line=%%a"
set "line=!line:*<XOrigin>=!"
set "line=!line:*<YOrigin>=!"
set "line=!line:*<XExtent>=!"
set "line=!line:*<YExtent>=!"
for /F "delims=<" %%b in ("!line!") do echo %%b
)) > result.txt


My Result is



502800
928000
23650
30750


I would like for it to come out



502800,928000,23650,30750


Any help?


No comments:

Post a Comment