move file based on text in body

October 9, 2009 at 09:28:04
Specs: Windows XP
I have a folder with xml files and in the xml files i find a specific word.
Based on this word, a new folder is created.
This works fine.

Now i have to figure out how to move the xml file into the right folder, based on that specific word.

Can anybody help me.

Below is what i've got so far.

echo off
for /f "delims=" %%f in ('dir /b /s *.xml') do (
FOR /F "tokens=2 delims=><" %%i in ('findstr "<name>" %%f') do (
mkdir %%i )
))


See More: move file based on text in body

Report •


#1
October 9, 2009 at 09:58:45
Nevermind, i've got it:

echo off
for /f "delims=" %%f in ('dir /b /s *.xml') do (
FOR /F "tokens=2 delims=><" %%i in ('findstr "<name>" %%f') do (
mkdir %%i
move %%f %%i )
))


Report •
Related Solutions


Ask Question