Hello friends,
I apologize if posting this in the wrong forum. Saw a similar post here so thought I would start here. Please point to correct forum is I am wrong.
Problem: I have an *.xml file that I want to look through one line at a time via a *.bat file. I need to find a specific node in the "Original.xml" file (usually at the end of file) and copy its value to a variable or an out put file.
--/////////////////
i.e.
"Original.xml"
<Parent>
<something>
blahbalbhablha
</something>
<last_thing>
ThisIsWhatIwant
</last_thing>
</Parent>
--\\\\\\\\\\\\\\\\
All I have so far is that I was able to find the <last_thing> node but can not traverse to the next line. My code:
--///////My Attempt////////
@echo off
::FIND THE STRING <last_thing>
FOR /F "tokens=1" %%Q IN ('FINDSTR /B "<last_string>" Original.xml') DO SET varString = %%Q
ECHO %varString%
--\\\\\\\\\\\\\\\\\\\\\\\\
Any suggestion or direction to the appropriate forum would be greatly appreciated.
Thanks,
-NerdWannaBe
I apologize if posting this in the wrong forum. Saw a similar post here so thought I would start here. Please point to correct forum is I am wrong.
Problem: I have an *.xml file that I want to look through one line at a time via a *.bat file. I need to find a specific node in the "Original.xml" file (usually at the end of file) and copy its value to a variable or an out put file.
--/////////////////
i.e.
"Original.xml"
<Parent>
<something>
blahbalbhablha
</something>
<last_thing>
ThisIsWhatIwant
</last_thing>
</Parent>
--\\\\\\\\\\\\\\\\
All I have so far is that I was able to find the <last_thing> node but can not traverse to the next line. My code:
--///////My Attempt////////
@echo off
::FIND THE STRING <last_thing>
FOR /F "tokens=1" %%Q IN ('FINDSTR /B "<last_string>" Original.xml') DO SET varString = %%Q
ECHO %varString%
--\\\\\\\\\\\\\\\\\\\\\\\\
Any suggestion or direction to the appropriate forum would be greatly appreciated.
Thanks,
-NerdWannaBe