change the filenames of a parallel structure

So, I have a little problem and not really an idea how to solve it, but maybe you have.

I have a large music library and all the files were .wav files. Over time some of the file name and folder structures became a little messy. Now I converted all files to .flac files and made sure every file was tagged correctly. Now I wanna change the file structure into [Artist/Album/00. Artist - Title] and use my tags as the source. That itself is not really a problem, but I would like to also keep my .wavs, just in case, I would like to find a way how to also change the names of the .wav files and the structure the exact same way as my FLACs. At the moment, apart from the file names and folder structure of the FLACs and the WAVs are exactly the same, apart from the file ending.

I would appreciate if any of you could help me out.

just deleting the .wavs is not an alternative.

If you keep the wav files in the same folder as the flac files and you keep the discipline only to rename the folder and never the filename, you are fine.
And unless you create a naming scheme with a unique identifier in the filename I would think that you are lost as you cannot store any of the linking information in the wav files.
So I would think: you are stuck with the wav files as they are. Backtracking changes would even be difficult for files with tags ...

You would have to keep a table that links the old filenames with the new ones as this is the only attribute that describes the wav file.
So: you could create 2 user-defined field in the flac file
one shows "the old" filename of the wav file to which it is linked.
the other shows the up-to-date filename of the flac file. Ideally they are the same, except for the extension.

Now: if you update the name of the flac file, you also update the user-defined field with the flac-filename.
Then you run a report that creates a batch file with a "rename" command
ren %wavfile% %flacfile%
Run that batch job in the folder.
Now all wav-files should have the updated name of the flac-file.
Finally you update all flac files so that both user-defined fields (%wavfile% and %flacfile%) show the same contents again...

Thank you for your answer. Sounds pretty much like what I need, unfortunately I don't really know how to do all of the things you told me to do.

Makes sense. I originally planned on just using mp3tag and change the file structure that way. What would be the adequate way to rename only the folder? that would already solve a lot of my problems, since the filenames of the .wav files are not the biggest problem if I could just get the folder structure right artist/album

Sounds great, except I don't really know how to do so, could you go a bit into detail?

You can rename the current folder with the help of MP3tag if you apply an action of the type "Format value" to _DIRECTORY.
In general the starting point is the current folder. The more information you supply for the renaming, the less relative becomes the target folder.
So, the safest way to end up exactly where you want to be, use a full path including drive letter to describe the target folder, e.g.
e:\music\%albumartist%\%year% - %album%

The other thing with two variables. And the more I think about it, I come to the conclusion that only one is good enough.
The whole thing is only necessary if you want to modify the filename of the flac file and still know which wav file served as source. If this is irrelevant, then you can leave out all of the next stuff.

Now, you say you have these files:
00. Artist - Title.flac
00. Artist - Title.wav
Only the flac file can store data in tags.
Create an action of the type "Format value" for OLDFILENAME (this is the name of the user-defined field. You will only see this in players that know how to cope with user-defined fields. And in MP3tag):
Format string: %_filename%
This stores the current filename in the field OLDFILENAME
You say that right now the wav-files have the same name except the extension. So everything is fine now.

As it may happen, you might get the idea to modify the filename e.g. because you spotted a spelling mistake.
You can now filter for files where the current (flac) filename does not match the contents of the field OLDFILENAME:
$if($eql(%_filename%,%OLDFILENAME%),1,0) IS 0
Files that appear in the list show that the current filename is not the one that has been used for the pair of flac and wav.
You can now use an export script to create a shell-batch-job rename the wav file so that it has the same name as the flac file again:
$loop(%_filename%)ren %OLDFILENAME%.wav %_FILENAME%.wav$loopend()

Execute that batch-job and the wav-files should be renamed.
Finally, because every thing is fine now, you can perform again the action that I described above to store the now vaild name for the flac-wav-file again.

This makes no sense. Maybe you could restate it. Are you saying that the folder names are all exactly the same in both WAV and FLAC directory trees, but only the file names are different?

You need some way to correlate the FLAC folders and files to the WAV folder and files. If the folder or file names have changed, I'm not sure how you could do that, even if the folder structure has remained the same. If the folder names are all still the same, and only the file names have been changed, it might be possible if the WAV files have track numbers.

Beyond that... I can't see it, other than to use a well-written program that would match FLAC folders to the WAV folders by matching the exact number of tracks and the lengths (in minutes and seconds) of each track. This is how ripping programs match CDs to online databases.


I have [favorite bands first album\song 01.wav] converted to [favorite bands first album\track 01.flac]. Now I want it to be both [favorite band\favorites band first album\01 title.wav] and [favorite band\favorites band first album\01 title.flac].

Is that more clear?

Actually I think orhenkinos suggestion is pretty good and might work, i will try it as soon as I have time for it.

What is with using the Windows Explorer to copy one foldertree onto the other foldertree?
Afterwards delete the superflous foldertree.


I don't know if I have understand the original problem.
What I understood ...
You have converted wav-files to flac-files.
Both filetypes reside in the same folder ("...\favorites band first album").
You want to move the files into a folder "...\favorite band\favorites band first album".
This should be done by "renaming" the folderpath.
Select the flac files you want to move and apply the following action.

Action : Format value Tag-Field : _DIRECTORY Formatstring: '.\favorite band\'%_directory% ... or ... Formatstring: '.\'%ARTIST%'\'%_directory%