# Mass Tag using XML files

**URL:** <https://community.mp3tag.de/t/mass-tag-using-xml-files/19134>\
**Category:** Support\
**Created:** [July 11, 2017, 6:04pm UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134 "2017-07-11T18:04:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![icepick94](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/278dde/32.png) [@icepick94](https://community.mp3tag.de/u/icepick94)\
**Post date:** [July 11, 2017, 6:04pm UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/1 "2017-07-11T18:04:05Z")

</div>

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.

Any ideas?  
Thanks!

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [July 12, 2017, 3:03am UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/2 "2017-07-12T03:03:11Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)\
**Post date:** [July 12, 2017, 3:07am UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/3 "2017-07-12T03:07:05Z")

</div>

Give us an example how the xml-file looks like.

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [July 12, 2017, 7:55am UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/4 "2017-07-12T07:55:07Z")

</div>

> [@icepick94](#):
>
> ... The Metadata for each song is stored in a separate XML file. ... Is there a way to get MP3Tag to use the XML file in a mass tagging operation? ...

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?

> [@icepick94](#):
>
> ... How Do I get MP3Tag to read the individual XML file for each .WAV 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.

DD.20170712.1155.CEST

---

<div class="post-metadata">

**Author:** ![icepick94](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/278dde/32.png) [@icepick94](https://community.mp3tag.de/u/icepick94)\
**Post date:** [July 12, 2017, 10:51am UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/5 "2017-07-12T10:51:38Z")

</div>

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:
<XMLDAT>
    <Version>1</Version>
    <Cart>10223</Cart>
    <Cut>1</Cut>
    <Type>2</Type>
    <Category>AC/HOT AC</Category>
    <Title>SMOOTH</Title>
    <Start_Time>03/16/2009 00:00:00</Start_Time>
    <End_Time>01/02/2100 11:59:59</End_Time>
    <Archive_Time>01/02/2100 11:59:59</Archive_Time>
    <Modified_Time>03/16/2009 12:11:06</Modified_Time>
    <Overall_Tempo>1</Overall_Tempo>
    <File_Name>G:\001022301.WAV</File_Name>
    <Length>240541</Length>
    <Runtime>232490</Runtime>
    <Intro_3>9594</Intro_3>
    <Outro>0</Outro>
    <Intro_Start>0</Intro_Start>
    <Outro_Start>0</Outro_Start>
    <Cross_Fade>8051</Cross_Fade>
    <Comments></Comments>
    <Erase_Time>01/02/2100 11:59:59</Erase_Time>
    <Replay>0</Replay>
    <User_Define></User_Define>
    <Fade>0</Fade>
    <Fade_Up_Start>-1</Fade_Up_Start>
    <Fade_Up_Length>-1</Fade_Up_Length>
    <Fade_Down_Start>232490</Fade_Down_Start>
    <Fade_Down_Length>2000</Fade_Down_Length>
    <Intro_1>0</Intro_1>
    <Intro_2>1</Intro_2>
    <HeadsTails>0</HeadsTails>
    <Artist>SANTANA/ROB THOMAS</Artist>
    <AudioNotes></AudioNotes>
    <ProductionType>0</ProductionType>
    <Label_ID></Label_ID>
    <Label></Label>
    <Album></Album>
    <FilmName></FilmName>
    <MetaData_ID></MetaData_ID>
    <Composer></Composer>
    <ArtistID>12</ArtistID>
    <CategoryID>62</CategoryID>
    <LicensorID>-1</LicensorID>
    <RatingCode></RatingCode>
    <ContentLevel>-1</ContentLevel>
    <Mix></Mix>
    <ISRC>USAV70000050</ISRC>
    <HookStart>0</HookStart>
    <HookEnd>0</HookEnd>
    <HookFadeUp>0</HookFadeUp>
    <HookFadeDown>0</HookFadeDown>
    <Product_ID>0</Product_ID>
    <Artist_ID>0</Artist_ID>
    <Mediabase_ID>0</Mediabase_ID>
    <Apple_ID>0</Apple_ID>
    <URL></URL>
</XMLDAT>
```

---

<div class="post-metadata">

**Author:** ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)\
**Post date:** [July 12, 2017, 12:06pm UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/6 "2017-07-12T12:06:13Z")

</div>

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:  
[https://superuser.com/questions/1038868/con...y-in-powershell](https://superuser.com/questions/1038868/convert-xml-to-csv-automatically-in-powershell)

But for use with Mp3tag, you will probably have to remove the CSV header line some how.

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [July 12, 2017, 6:15pm UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/7 "2017-07-12T18:15:03Z")

</div>

> [@icepick94](#):
>
> The XML file is the same name as the WAV file.  
> I.e 001022301.wav and 001022301.xml ...

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')

DD.20170712.2215.CEST

---

<div class="post-metadata">

**Author:** ![icepick94](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/278dde/32.png) [@icepick94](https://community.mp3tag.de/u/icepick94)\
**Post date:** [July 12, 2017, 7:47pm UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/8 "2017-07-12T19:47:13Z")

</div>

Thanks for the suggestion. I am looking into it now.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [July 13, 2017, 3:43am UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/9 "2017-07-13T03:43:57Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:26pm UTC](https://community.mp3tag.de/t/mass-tag-using-xml-files/19134/10 "2026-02-09T12:26:53Z")

</div>


