You can import tags form a text file either ...
from a text file where the sequence and number of the records in the text file matches that of the selected files
or ...
from a text file where there is one field per record that represents the filename - MP3tag would then take the rest of the data from that record to assign it to the tags in the named file.
If you want to use this convert function, then you have to supply a list of fields which should be imported, separated by the correct separator.
E.g. this record structure
|19604625 |Shadows |Man Of Mystery |3 |13/11/1960 |25 | |
could be imported with such a mask:
|%my_id% |%title% |%artist% |%track% |%mydate%|%dummy% |%dummy%
if the number 19604625 is actually the filename, you would have to add .mp3 in the data source, so that the record becomes:
|19604625.mp3 |Shadows |Man Of Mystery |3 |13/11/1960 |25 | |
and the mask could modified to:
|%_filename% |%title% |%artist% |%track% |%my_date%|%dummy% |%dummy%
1: the number and sequence of files matches exactly the number and sequence of records in the text file. One record is represented by one line of text, terminated by the paragraph termination characters carriage return and line feed.
2: a record contains one piece of data that represents the filename. Then the data of that record is assigned to the tags in the file according to the rest of the mask.
The number and sequence does not necessarily have to match each other.
So you have to decide which of the 2 modes you want to use.
If you can, use mode 2 as this leads to the fewest surprises. You would have to find a way to get the field for the filename (with extension), though.
For the import in mode 2, select all files, even if they do not have a matching record or even if there are more records in the text file than there are files. This should work... as long as matches are found.
Hi all,
This is very powerful and useful - however I am having problems getting it to work in mode 2.
I have tried more entries in the file than selected MP3Tag files and the other way around but it always seems to work in mode 1.
It would be really nice if you could select which mode you wanted it use - regardless of the number of selected records and the number of file entries.
one of the fields in each record has to be %_filename%. If the contents of that field matches the filename, then the contents of the other fields get assigned to the tag fields in the file.
Thanks for the prompt reply.
I am pretty sure I tried %_filename% in several scenarios - but I will have another go.
Ideally if you want and could select mode 2 and no matches occur (for whatever reason) it would not do anything - at the moment, as I understand it, if no matches occur it will switch to mode 1 and potentially mess up your (mp3tag) files with all the wrong information.
No, you would get an error message that the lines could not be parsed - simply because the fiield %_filename% is included in the mask but not in the data.
Or you have the field %_filename% but you have not mentioned it in the mask - so the records and the import instruction do not match.
After a bit of investigation I have found that a small typo in ohrenkino's script and instructions has been causing the problem.
Rather than using %_filename% it should have been %_filename_ext%.
This now works perfectly in my tests and only uses mode 2 and reports any matches it did not find.
It also does not switch to mode 1 if it finds no matches at all
So if Silver Surfer is still listening here is a modified version of the script that should work for you.
It seems that mode 2 (IE when it searches the text file for a match) only works with %_filename_ext% but that is not a problem - just glad to have this powerful feature working.
Just tried this out, i picked a random file somewhere near the middle and it failed which is a good thing the error was no "matching file"
So Terry you missed this bit a filename will have at the end of the numbers a letter as in 19901225C.mp3 but the text file will not have the C if there is a matching record it will be 19901225
So what i'm wanting is to ignore the C in the filename
Yes, you mentioned in a previous post that the actual file name may have up to three different letters at the end.
The problem here is that %_filename_ext% has to be used to get mode 2 (the search mode) to work and it has to match the file name in the text file.
I believe you have already added .mp3 to make up the file names in the text file so a quick solution would be to change it (using a text editor) to c.mp3 this will add the C to the end of all the file names in the text file.
For example: 19602232.mp3 becomes 19602232C.mp3 in the text file.
Then run the MP3Tag convert function - this should process all the files with a final C and, importantly, ignore the rest.
Then (using a text editor again) change all the c.mp3's to (say) a.mp3 in the text file, then run the MP3Tag convert function again to process all the matching files that have a A at the end and so on.
It is bit of a clunky solution but should work.
Note: I have assumed that the numbers in the files are unique regardless of final letter.
I think it is very hard to tell from the distance why there is no match. We do not see the files, we do not see the import data, we do not see the mask.
It is a little puzzling for me why the properties show the fiel extension twice: (.mp3) (.mp3)
If I open the properties of an mp3 file, I see it only once...
So could it be that the files are called e.g. 19824139C.mp3.mp3?
(Probably not)
But showing the extensions would reveal if the file name has e.g. a blank at the end in front of the extension.
Or you could copy the filename in all its beauty from the text file and paste it into the filter box and see which file is found.
The filename
19824139C.mp3 does not match
19824139C .mp3