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
(although xml is not a suitable format).
Give us an example how the xml-file looks like.
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.
The XML file is the same name as the WAV file.
I.e 001022301.wav and 001022301.xml
The system will export the metadata only in two file types: XML and a proprietary DAT file format.
XML Data found in XML file:
You can try converting the XML files to CSV files.
There are various online sites that do this.
Or, for the command line, see here:
But for use with Mp3tag, you will probably have to remove the CSV header line some how.
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"
Action "Format value"
Format string: $regexp(%XMLDAT%,'^.(.+?).$','$1')
Thanks for the suggestion. I am looking into it now.
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)