I need a batch script that will read in another batch script (batch2) and:
- look for the string "configout:" OR "configin:"
- If it encounters one of these two strings, extract what's after it until the string ".xml"
- copy paste it in a new text file.
- and do this for each line of batch2.
For exemple: If this is my first line in the batch script
/configin:%faxml%fm_sellin_in.xml /configout:%faxml%transco_fm_sellin_out%col_transco%.xml /inputfile:
I should have this in my text file:
%faxml%fa_sellin_in.xml
%faxml%transco_fm_sellin_out%col_transco%.xml
I have seen a good code in Here:
for /f "tokens=1-2 delims=~" %%b in ("yourfile.txt") do (
echo %%b >> newfile.txt
echo removed %%a)
but i don't know how to adapt it to my specific case.