Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi there. Here is my problem:
Folder A has a large number of mp3 files in it. It's constantly being added to by an automatic ftp download each night.
Folder B is a play out folder. it contains the same files which are manually copied and then renamed by FlashRename with a 1000_ incremental prefix.What I would like to do is create a batch file that would compare each file from Folder A and Folder B. If the same file does not exist it copies the file from Folder A to Folder B.
This would be great. What would be even better would be if the batch could track the dates listed in the file names. In the case I'm working on the file names are "1040_sly_Mar0209.mp3 . 02 is the day, 09 is the year.
To start to compare file names I need to be able to ignore the prefix and first underscore.
I'm currently playing with dir /b. I was trying to see if I could list the mp3's without the prefixes.
Something like you use to display specific characters in the set command.
Anyways, pleace throw a dog a bone.
Thanks.

Am I right?
Do you want to compare only the filenames or would you like to compare the file?If you would like to compare the files, I wonder, if that is what you really want.
Assuming there are 100 files in folder A and 1000 files in folder B.
So you will compare 1 file with 1000 others.
That gives 100 x 1000 = 100000.So lets assume each comparison takes 5 seconds.
It take 500000 seconds or 8333 minutes or 138,8 hours.I think, you won't do that every night.
;-)Please send a reply, if you solved the problem !!!

Hi Paul, thanks for the reply.
for starters I need to look in Folder A then look in Folder B to see if there is a filename with the same name except it will have a 4 digit prefix.
Folder A
sly_Mar0209.mp3
sly_Mar0309.mp3
sly_Mar0409.mp3
sly_Mar0509.mp3
sly_Mar0609.mp3
sly_Mar0909.mp3
sly_Mar1009.mp3
sly_Mar1109.mp3Folder B
1045_sly_Mar0209.mp3
1046_sly_Mar0309.mp3
1047_sly_Mar0409.mp3
1048_sly_Mar0509.mp3
As you can see there are 4 files in Folder A that are not in Folder B. These need to be copied over and have the incremental prefix attached to the file name in order.Has this made it clearer?
Even if I can get part of this solved that would be great.
Thanks for your time.

From beginner back to you !!!
for /f "tokens=2* delims=_" %%i in ('dir /b "*.mp3"') do @echo "%%i_%%j"
This should give you an idea, on how you can manage it.
Please send a reply, if you solved the problem !!!

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |