Ok, I've been at this for days now. And I've tried it step by step but there's always something going wrong.
What I'd like to do is this: I have my entire music collection on an external HDD. I'd like to run a batch file that will:
- go into each category folder (category is the first letter of the artist name)
- create a markdown file for the category listing each artist in the category
- go into each artist folder
- create a markdown file for the artist listing each album
- go into each album folder
- create a markdown file for the album listing each track
- create an mp3 folder and move all the mp3s for that album into it
This is what I've tried (and many variations of...)
Make a temp list of categories..
for /f %%I in (.) do break > %%~nxI
dir /b /o:n /a:d > temp_categories.txt
For each category, make a category markdown file
for /f "delims=" %%C in (TEMP_categories.txt) do (
echo The %%C category >> %%C.md
Then I basically do the same thing to go into each artist folder and each album. When I get in the album folder, I add...
mkdir mp3
move [/Y | /-Y] *.mp3 mp3
It works up until it gets into the first album of the first artist in the first category. It adds the mp3 folder but doesn't move the files and it never goes to the next item.
I realize this is probably not the best code. But I only need it to work once. Otherwise I'll need to do everything manually.
break > file.extcreates an empty file (0 bytes)