On Wed, 13 Jun 2007 14:43:01 -0700, doubleJ
<(E-Mail Removed)> wrote:
>Ok...
>Here is the final code that I have. It works and does, pretty much, exactly
>what I want. Thanks for letting me know about pushd/popd. I had not seen
>those before this week.
>
>[01]@echo off
>[02]setlocal enabledelayedexpansion
>[03]pushd \\audioserver\audio1
>[04]for %%a in (\mp3\productdvdbatch\*.mp3) do (
>[05] set yfn=%%~nxa
>[06] for /f "tokens=1,2,3,4 delims=-" %%b in ("!yfn!") do (
>[07] if "!yfn:~0,2!" == "01" (
>[08] md \mp3\productdvdmerge\Singles
>[09] copy /B
>\tags\copyright-128-44100-mono.mp3+"%%a"+\tags\wordsender-128-44100-mono.mp3
>"\mp3\productdvdmerge\Singles\%%c"
>[10] )
>[11] if not "!yfn:~0,2!" == "01" (
>[12] md \mp3\productdvdmerge\%%c
>[13] copy /B
>\tags\copyright-128-44100-mono.mp3+"%%a"+\tags\wordsender-128-44100-mono.mp3
>"\mp3\productdvdmerge\%%c\%%d-%%e"
>[14] )
>[15] )
>[16])
>[17]popd
>
>My only annoyances are that I had to duplicate the md/copy commands for 01
>files and then everything else. Of course, it tries to make the directories
>over and over, but fails as it's already there.
>If anyone wants to show me ways to make the code more effecient, I would be
>interested to see your versions.
>
>What the batch does is...
>1: Queries a bunch of mp3s in a single directory
>2: Splits the filenames up by "-"
>3: Creates directories based on the 2nd "-"
>4: Merges the mp3s with two other mp3s
>5: Copies the new mp3s into the directory that was just created
>6: Renames the new mp3s using everything after the 2nd "-" in the original
>name
>
>All in all, it is pretty cool. It took a good day of work to get it all
>working.
This will eliminate the error messages regarding the folders
>[08] md \mp3\productdvdmerge\Singles 2>nul
>[12] md \mp3\productdvdmerge\%%c 2>nul
If you can post a filename with and without an "01" we can see what's
causing the difference.
|