Copy tag from one track to empty field on another track

...search the forum but didn't find a solution.
This is NOT the usual copy value question.

I have a TAG %LABEL% which is not filled out on every track in the album.
So i look for a BATCH solution to copy the filled out value from one track to the other tracks which do not have this value.

filtering for "empty value" is not a solution, as i do not know the value for the empty fields, as the value should come from an "neighbour track" from same album

Any hints?

There is no Action like "copy from neighbour track".
What you can do is to select a "source track" containing your %LABEL% content.
Then manually copy this content from View -> Extended Tags
Select one or multiple "target tracks".
Then manually paste the value into this selected tracks in View -> Extended Tags.

Just a simple remark

There is no such thing like "empty value".
A tag only exists WITH content.
Otherwise it does not exist at all.
There is no tag without content.

okay, so no batch solution? Extended tagging isn't batch....
Is it allowed to ask here for "other" non mp3tag solutions, perhaps?

I think there are 2 approaches:
1st: create a corresponding field in the tag panel, select all the files that should get the same data for %LABEL%, enter the data in the field in the tag panel, save the modification.

2nd: filter for all the files that have the LABEL filled. Provided that files in the same folder should get the same data in LABEL, filter for files that have already data in LABEL (%LABEL% PRESENT), then rename the folder with
Convert>Tag-Tag for _DIRECTORY
Format string: %_directory% __%label%
Now filter for the files without LABEL
%label% MISSING
Use Convert>Filename-Tag
Format string: %dummy%__%label%\%dummy%
to import the data from the folder name.
Later, you could rename the folders again with
Convert>Tag-Tag for _DIRECTORY
Format string: $regexp(%_directory%,(.*)__.*,$1)

thanks, as solution 2 is to intrusive for a lot of directories, i'm hesitate to use it, but made me think.
Is it possible to batch export (into album directory) and then batch import from that file again?
Perhaps before import batch modify the exported files to strip / add some data....

You could write an export script to export the contents of LABEL,
then use

As we are discussing the whole affair on a fairly theoretical level:
How often in the lifetime of a file will this problem arise?

Could user-defined values for a tag-field help?

as i'm fixing my discogs / musicbrainz tagging, honestly quite a lot.
Thanks look into your proposed solution

user defined fields won't help as i do not know the values upfront.
I've tested the export/import suggestions. This also doesn't work for me, as the values in the export file are track based.
Means: if i have an album of 8 tracks, i need 8 values. I do not found a way to import
1 value to 8 files at once.

As i have for example 8 files but only 4 values, i have an eight line export file with 4 lines with values and 4 empty lines
Import back to the files leads then to the proposed outcome, 4 with values, 4 with no values

Have you tried it?
As the referenced action does exactly that: add the contents of the text file to the specified field in each of the selected files.
You do not need e.g. 8 values

yes tried first, wasn't working. tried again, had partly a success, so first was an user error i guess, but i'm not there yet completely

My export file


$filename(New export file.txt,utf-8)
$loop(%track%)
%label%
$loopend()

but the tag gets filled with spaces in the beginning and at the end, so the value seems centric.
Looks like:(forget the ")
" My Label. "
should be
"My label"

the existing value has no spaces. Only after import

used the quick action import text file

You do not tell on which files you use your export.
If you use it on files that do not have the field LABEL, then you get empty lines.
As the referenced function imports all of the text file into the named field this might appear as spaced.

The export script should be used only on files that have data in the field LABEL - and preferably feature only a single line.

i've filtered with LABEL PRESENT

but i still get exported files (with the above config)
which look like
this is an empty line
this is an empty line
Label

or on another album
this is an empty line
Label
this is an empty line
Label
this is an empty line
Label

something wrong with CR/LF at the end i guess....

It is the "feature" of export scripts that the number of lines in the export script is also reflected in the script's output.
Try go get the code into a single line and only the number of line breaks that you want to see in the data.
(Wouldn't renaming the folders be easier?)

@mamema As it seems that you are no longer fixated on a batch solution:

it would be much easier to use @ohrenkino's first solution with the Tag Panel and its customization with your LABEL tag.

(Wouldn't renaming the folders be easier?)
no, as this would kick off a huge backup of my files.
mp3tag can tag files without changing file properties, so i can prevent that.
Woohoo! The export file on one line did the trick
mp3tag is allmighty!
Unfortunately i've still not found the Action "Pay my bills"

As it seems that you are no longer fixated on a batch solution:

what lead you to that conclusion?
The batch approach still works
I've just need to export my stuff into files per folder (have album per folder) like so:

  1. Filter LABEL PRESENT
    2 export with path %_folderpath%\00 csv tag dump of label.csv
    3 import with path %_folderpath%\00 csv tag dump of label.csv

this is not possible with the tag panel

What exactly do you manually change in the
00 csv tag dump of label.csv
between step #2 and #3?

I think you are missing a manual change of filter or removal of filter between steps 2 & 3.

yes, removing filter, you both were to fast before i can edit my post

even though working as @ohrenkino suggests that only one file with tag should be exported
can the LABELS PRESENT filter be adapted, something along the lines: if one file with label from this album is listed, stop with this album listing files