Copy COMMENT from #01 to other tracks


#1

I have a date set in the COMMENT field for all of my FLAC files - this was sourced from the file modified date, and will be used for playlist creation.

The problem I have is that some of the albums don't have consistent dates throughout the tracks. For instance:
Track 1: 15/08/2009
Track 2: 14/07/2009
Track 3: 15/08/2009
Track 4: 15/08/2009

Is there a way I can copy whatever comment is set in track 1 to the other tracks on the album? Also, I don't want to have to go through and check my 900+ albums individually for this problem, so is there a way to automate this over different albums?

Many thanks for a great program.


#2

Hmm, when you are in the Mp3tag list view window, then you can manually copy and paste from cell to cell. This works as fast as you can. The advantage of this method is that you easily can see where you have to repair a date.

Another possible way would be writing an export script, which creates a text file with each line containing comment and path data for later re-import the comments. By clever usage of the $loop() function it should be possible to fetch an albums's first comment's value and put it out to the following tracks.

DD.20101110.1952.CET


#3

That's a bit beyond my current capabilities, but it sound like it would be worth me investigating it.

For ease, I just want to run it against my whole library. The files where the dates are already correct will not be adversely affected by doing this, so it saves a lot of time doing the whole lot.

I knew about copying and pasting, but that would take me forever.


#4

If you have stored every album in a seperate folder, you can also make a workaround by formating the folder name.

Make a Action group containing the following:

Action: Formant Value
Field: _DIRECTORY
Format String: %_directory%XXXXX%_file_mod_date%
(this will add the modification date of the first file to the folder name)

Action: Guess Values
Source Format: $replace(%_directory%,.,/)
Guessing Pattern: %dummy%XXXXX%comment%
(this will write the comment. the $replace(...) is for replacing . with / in the date)

Action: Replace with Regular Expression
Field: _DIRECTORY
Regular Expression: XXXXX.*
Replace Matches with:
(this will write the folder name back in the way it was written before)

EDIT:
If you want the comment and not the acutal modifaction date for all files (as you have written), you must you the format string
%_directory%XXXXX$validate(%comment%,.)
in the first action.

I found out with testing that the whole process only works if you run the three actions seperatly one after the other. When you combine them in a action group, the comments stay as they are.


#5

There is a way to go:

  1. Make sure, that all files within an album contain a correct track number starting with a value of 1.

  2. Make sure, that the first track of each album contains a tag-field MY_FIELD (can be of any name) with the content value, which should be copied into all files from this album.

  3. Run the following export script against all selected albums resp. their files.
    Adapt the output filename to your needs.

    $filename(O:\TEST\FirstToAll.PerAlbum.txt,UTF-8)$loop(%album%)$loop(%track%)'"'$put(Item,$if($eql($num(%track%,1),1),%MY_FIELD%,$get(Item)))'"|"'%track%'"|"'%_path%'"'
    $loopend()$loopend()

  4. Import the values from the export script's output by using converter "Textfile - Tag" into the target tag field of all files from the previous file selection.
    Adapt the input filename to your needs.

Converter "Textfile - Tag" [Alt+4]
Filename: O:\TEST\FirstToAll.PerAlbum.txt
Format string: "%MY_FIELD%"|"%TRACK%"|"%_PATH%"

  1. Ready.

DD.20101111.2055.CET