Where is my mistake ?
Posted: 08 Jan 2017 13:57
I am new here
Sorry, who wants to communicate with me in German, has 200% bonus, everything else the translator has broken
Sorry, who wants to communicate with me in German, has 200% bonus, everything else the translator has broken
Code: Select all
@ECHO OFF
setlocal enableextensions
CLS
rem generate Testdata
mkdir "VA - The Doome 000"
cd "VA - The Doome 000"
echo X > "01 - Horst P - Titel1.mp3"
echo X > "02 - Beba - es muss.mp3"
echo X > "04 - John Smith - doch gehen.mp3"
cd ..
mkdir "VA - XY Sisters"
cd "VA - XY Sisters"
echo X > "04#Heidi#Intro.mp3"
echo X > "08#Santa C#No name.mp3"
echo X > "13#Children#Games.mp3"
cd ..
rem Delims can only process one character, would be " - ", so I replaced the " - " with "#"
for /f "tokens=1,2,3 delims=#" %%a in ('dir /a /b /s *.mp3') do (
set track=%%~na&set artist=%%b&set titel=%%c
echo.Track : %track%
echo.Artist: %artist%
echo.Titel : %titel%
echo ---------------
)
pause
rem My second hurdle is, it works so, but I so only the last entry get, so not to use.
for /f "tokens=1,2,3 delims=#" %%a in ('dir /a /b /s *.mp3') do set track=%%~na&set artist=%%b&set titel=%%c
echo.Track : %track%
echo.Artist: %artist%
echo.Titel : %titel%
echo ---------------
pause
rem dir clean
rmdir /s /q "VA - The Doome 000"
rmdir /s /q "VA - XY Sisters"
set track=
set artist=
set titel=
endlocal