Sign in with
Sign up | Sign in
Your question

Move the searched file from XML to a directory with a batch file

Tags:
  • XML
  • Apps
  • Filename
August 26, 2014 11:38:13 PM

I am a newbie to batch file creation. Your help is much appreciated. Kindly help. My requirement is as like below.

1) I have a directory with different files. (Eg: 10225_1409069145475_desc.xml, 24185_1409063749859.pdf, 881_1409076406553.htm etc).

2) I have to read all XML files one after the other among the available files in the above directory and compare the string. String is definitely embedded between <reportSearchPath> and </reportSearchPath> tags with different special characters (Eg: <reportSearchPath>/content/folder[@name='Finance - Governed Reports']/folder[@name='Management and Board Pack']/folder[@name='Production Version']/folder[@name='Reports modified for 2015']/folder[@name='Reports ready for UAT']/report[@name='MGT 9a - Project Resource Summary Report']</reportSearchPath>).


3) When the search string matches, it has to pull file name from the same xml. Filename is again embedded between <fileName> and </fileName> tags.

4) File name that found in the above has to be moved to different directory. FYI, searched file resides in the same directory.


I would like to schedule this batch once a day to move the files to another directory.

More about : move searched file xml directory batch file

!