Batch import text file to tag

Hello,

I was trying to search for it, but cannot find an answer. My problem is simple. I have lot of folders with mp3 albums. Each folder is 1 album with several mp3 files inside. Inside each folder I have txt file with some tag information. I need to import those tag info into the mp3 files. But problem is if I use Convert - Text file - Tag, then I can do it only for 1 album at once and if I try to use action Import from text file, then I cannot process different files with different tags in the txt file and all is written into the single tag field and the same info into all the files.
I just need to load all mp3 files in all the folders into Mp3tag and then batch process all the txt files and import tags from them. Ive found this is not a problem in reverse way with actions (auto creating those files from mp3 files), but how can I import it back from txt to mp3 tags? Is this possible somehow?

Thank you for any help

Have a look at this thread and see if you can somehow match your data with MP3tag's requirements:
Get tags from file

I've been looking on that thread already before and didn't find what exactly I need. Looking again and still don't see it there. Correct me, if I'm missing something.
File names doesn't match i my case, so I cannot use mode 2, but track order does, but only per album. I can do it for one album/folder with Convert - Text file - Tag with no problem, but if I have lot of these folders/albums, then I need some batch way. First I thought I can do it with the action file similar to export, but I cannot and with the Convert - Text file - Tag I was unable to find any way, how to batch process more folders, when every folders has its own txt file inside.

Ok.
So right now, you can only go the hard way: album by album.
If you find a way to merge all text files and get the file name into those files, then you can do it in one go. Sorry.

Ok thank you for reply anyway. Merging the text files and getting the file names is not possible any easy way in my case if not impossible.
Any plan to add such a function to Mp3tag in the near future? It should not be hard to implement it as batch process, when it works just fine for single folder and when this already works fine in reverse way - TAG --> TXT file as batch with the action.
I believe this may be useful also for other users and may make this great software even better :slight_smile:

No. This is not easy: you can specify only one file. MP3tag does not know anything about folders, in general MP3tag does not read text files, it collides with the function to assign the tags from one text file to more or less any amount of tags.

So I doubt that this will ever become a feature.

Correct me again if I'm wrong, but Mp3tag has a variable %_workingdir%, so it should know its actual working dir and the txt file is always stored in current working dir and always has the same name. So I thought it can just get the file from current working dir (that already works for single folder)
and then compare the current working dir of txt file with current working dir of actual mp3 file (current folder for each mp3 is also already working, because I can export the tags to txt files for each folder) and if the actual working dir for mp3 changes, then just use new path and load the new txt file into the memory and start again from line 1 for next folder. The same for next folder, because that's again current workingdir and again and again to the last mp3 file.

edit: I simply mean make it as it is now for Convert - Text file - Tag with only one exception. Current path will be checked for each mp3 file and when it changes, new txt file will be loaded from current working path and line count will be reseted.

And this is the exact problem: in actions you cannot reset a variable (or that is : THE variable, which is %_counter%).
A reset would have to be triggered by a comparison: is the current value (of a field/property) equal or not equal to the previous one.
And MP3tag does not compare properties between files. So any kind of relative address system does not work (here: the 3rd from the top).
You have to use an absolute address system: the filename. And that is already there.

I see. Here I wrote some script for AutoIt, which do what I need, so maybe it will be also useful for somebody. You just need to fill correct filename and format string in the Mp3tag Convert - Text file - Tag dialog and run the au3 script from the folder where you have the albums stored in subfolders. It's far from perfect, but looks like it works.

#include <Array.au3>
#include <File.au3>
; Close any running mp3tag process
If (ProcessExists("Mp3tag.exe") = True) Then
ProcessClose ("Mp3tag.exe")
EndIf
; Get all subfolders path from current working dir
; Do not use spaces in the dirnames
Local $aAlbumPathList = _FileListToArray(@WorkingDir, "*", 2, True)

; Process all albums from the list
Local $iNumberOfAlbumsLeft = $aAlbumPathList[0]
While $iNumberOfAlbumsLeft > 0
    Assign("sString", "C:\Program Files (x86)\Mp3tag\Mp3tag.exe /fp:")
    Local $sTemp = $aAlbumPathList[$iNumberOfAlbumsLeft]
    $sString = $sString & $sTemp
; run mp3tag with one album path
    Local $iPID = Run($sString, "", @SW_SHOWMAXIMIZED)
; wait for 2 seconds (you may need to increase or decrease that value depending on your system speed)
    Sleep(2000)
; select all files CTRL + A
    Send("{CTRLDOWN}a{CTRLUP}")
    Sleep(2000)
  ; shortcut ALT + 4 for Convert - Text file - Tag (you may need to change the key depending on your local keybord layout)
    Send("{ALTDOWN}č{ALTUP}")
    Sleep(2000)
; press enter
    Send("{ENTER}")
    Sleep(2000)
; Close Mp3tag
    ProcessClose($iPID)
    $iNumberOfAlbumsLeft = $iNumberOfAlbumsLeft - 1
WEnd