Computer Hope

Microsoft => Microsoft DOS => Topic started by: will2k on July 31, 2017, 05:30:12 PM

Title: rename xml using specific node variable position.
Post by: will2k on July 31, 2017, 05:30:12 PM
Hello friends I am trying to rename a group of xml files based on a specific node, which always changes position.
So far I have the following code that always works and cueando the position is fixed but as I say the position I need is variable.


The node that I need is the one that I set in image noIdentificacion =

this work with same position
@echo off
for /f "delims=" %%Z in ('dir /b *.xml') do (
   for /f "tokens=12 delims== " %%A in (
     'find /i "noIdentificacion=" ^< "%%Z"'
       ) do ren "%%Z" "%%A.xml"
)



I hope and they can support me. Thank you.



[attachment deleted by admin to conserve space]