I have a library of music that is in .WAV format without any tagging. The Metadata for each song is stored in a separate XML file. How Do I get MP3Tag to read the individual XML file for each .WAV file?
Ie. My directory contains 9770 .wav files. There are 9770 .xml files that have the metadata for each .wav file. They are all in the same folder.
Is there a way to get MP3Tag to use the XML file in a mass tagging operation? I'd hate to have to do this one song at a time.
There is no way that you can directly import data from an XML file.
For Import, the file has to have one line per record. So you probably would have to convert the files (anyway).
The action for importing data from a file allows a format string for the filename of the text file. So you can use any variable or text constant to create that filename. If it happens to be the filename of the audio file, then use
%_filename%.xml
(although xml is not a suitable format).
Is there any usable relation between the song file and the xml file?
How are the song files named?
How are the xml files named?
In the song file's tag, is there any tag field having an unique value (path, number, ...), which can identify the related xml file?
By loading each fitting xml file into an user defined tagfield within the related song file, via Action "Import text file", then with further actions it is possible to evaluate the loaded xml text and fill the related tagfields.
Once you have imported the data from the XML file via Action "Import text file" into a tagfield, e. g. named as XMLDAT, then you can evaluate the XML data and extract the values your are interested in.
Action "Import text file"
Field: XMLDAT
Filename: %_filename%'.xml'
Action "Format value"
Field: TITLE
Format string: $regexp(%XMLDAT%,'^.(.+?).$','$1')
An action of the type "Guess value" should also be possible.
If you have the same structure and sequence of pieces of data in all files, you could try something like
Guess value for XMLDAT
Guessing pattern: %dummy%%title%%dummy%%artist%%dummy%
(and so on)