# How to import txt tracklist to file name?

**URL:** https://community.mp3tag.de/t/how-to-import-txt-tracklist-to-file-name/15204
**Category:** Support
**Created:** [November 16, 2013, 7:02am UTC](https://community.mp3tag.de/t/how-to-import-txt-tracklist-to-file-name/15204 "2013-11-16T07:02:24Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [November 16, 2013, 8:49am UTC](https://community.mp3tag.de/t/how-to-import-txt-tracklist-to-file-name/15204/2 "2013-11-16T08:49:56Z")

</div>

> [@pique](#):
>
> Hello, I always download some music which without track number in the tag, and the files have no track number before the file name. it's just like "AAAAA", not "01 AAAAA". So, I want to import the tracklist to file name ... and i get the track list with track number ... How can I import the track list to file name with MP3tag?  
> And make sure the tracks will match with the name and number. ...

At first your question looks as if it is easy to solve with the converter "Textfile - Tag".

But because the list file of "Track Filename" entries probably does not contain the filename as an absolute path name, then the converter "Textfile - Tag" can not afford the appropriate allocation between the current file and its related track number.

With the following action group, the problem is quickly finished.  
In Action #1 adapt the filepath location of the input text file to your needs.

Begin Action Group **Test\_2013#MatchFilenameInListfile.GiveTrack** 

Action #1  
_Actiontype 14:_ **Import text file**  
_Field \_\_:_ **TMP\_LIST**  
_Filename:_ **'T:\TEST\Tracklist.txt'**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TMP\_LIST**  
_Formatstring:_ **$regexp($char(13)$char(10)%TMP\_LIST%$char(13)$char(10),'\s\*[\r\n]+\s\*','\r\n')**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TMP\_FN**  
_Formatstring:_ **$regexp(%\_filename%,'[\*+?|{}()^$.#\]','\\$0')**

 

Action #4  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TRACK**  
_Formatstring:_ **$regexp(%TMP\_LIST%,'^._\n(\d+)\s+(__'%TMP\_FN%')\r._$****','$1')**

 

Action #5  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TRACK**  
_Formatstring:_ **$if($eql(%TRACK%,%TMP\_LIST%),'0',%TRACK%)**

 

Action #6  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **TMP\_LIST;TMP\_FN**

 

End Action Group **Test\_2013#MatchFilenameInListfile.GiveTrack** (6 Actions)

 

There is an archive file containing the test case.  
[20131117.pique.rar](https://community.mp3tag.de/uploads/default/original/2X/e/ebc00d512f57cc336dd93b7e49529bf3fb1503c2.rar) (2.5 KB)  
DD.20131116.1118.CET  
DD.20131117.1305.CET  
DD.20131117.1510.CET

 

[20131117.pique.rar](https://community.mp3tag.de/uploads/default/original/2X/e/ebc00d512f57cc336dd93b7e49529bf3fb1503c2.rar) (2.5 KB)

---

_[View the full topic](https://community.mp3tag.de/t/how-to-import-txt-tracklist-to-file-name/15204)._
