# Applying information from one file to another based on file sequence

**URL:** https://community.mp3tag.de/t/applying-information-from-one-file-to-another-based-on-file-sequence/61903
**Category:** Support
**Created:** [August 25, 2023, 5:23am UTC](https://community.mp3tag.de/t/applying-information-from-one-file-to-another-based-on-file-sequence/61903 "2023-08-25T05:23:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jobasha](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/13edae/32.png) [@jobasha](https://community.mp3tag.de/u/jobasha)
#### Post date: [August 25, 2023, 5:23am UTC](https://community.mp3tag.de/t/applying-information-from-one-file-to-another-based-on-file-sequence/61903/1 "2023-08-25T05:23:13Z")

</div>

Hi!

I have a fair few classical flac files from the Classical mega box sets, and a fair number are titled as follows (%track%: %title%):

5: Op.4 No.1 in G minor, HWV 289: I. Larghetto e staccato  
6: II. Allegro  
7: III. Adagio - Andante  
8: Op.4 No.2 in B flat major, HWV 290: I. A tempo ordinario e staccato - Allegro  
etc.

What I'd like is the following:

5: I. Larghetto e staccato || Op.4 No.1 in G minor, HWV 289  
6: II. Allegro || Op.4 No.1 in G minor, HWV 289  
7: III. Adagio - Andante || Op.4 No.1 in G minor, HWV 289  
8: I. A tempo ordinario e staccato - Allegro || Op.4 No.2 in B flat major, HWV 290

Where %track%: %title% || %album%.

The problem here is that I'm carrying over information from the previous track. I was wondering if there was any way to do this?

Initially I thought, as the sequence of operations is guaranteed, a global variable like an environmental variable, would work, but I can't find a way of setting it, only getting it.

Thanks for any help!

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [August 25, 2023, 5:31am UTC](https://community.mp3tag.de/t/applying-information-from-one-file-to-another-based-on-file-sequence/61903/2 "2023-08-25T05:31:10Z")

</div>

MP3tag does not save or compare data from one file to another.  
So any information that should be rearranged must be "visible" from the current file.  
If you want to treat files, then do not use the filename as information storage but the metadata tags.

If you want to append a field like TITLE that has varying contents with a constant string, see the FAQs:

> [@Actions and batch-operations](https://community.mp3tag.de/t/actions-and-batch-operations/967/5):
>
> How to append the string " xyz" to the content of a tag field? Create a [new action](https://community.mp3tag.de/t/actions/967/2) in an existing action group and choose Format value as action type. Field specifies the tag field the formatting rule should be applied to. Format string must have the field placeholder for the field selected above and the string which should be appended. Example: If you want to append the string " xyz" to the current value of the comment field: Action type: Format value Field: COMMENT Format string: %com…

---

<div class="post-metadata">

### Author: ![jobasha](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/13edae/32.png) [@jobasha](https://community.mp3tag.de/u/jobasha)
#### Post date: [August 25, 2023, 5:59am UTC](https://community.mp3tag.de/t/applying-information-from-one-file-to-another-based-on-file-sequence/61903/3 "2023-08-25T05:59:38Z")

</div>

Hi ohrenkino!

Thanks for your response!

To clarify none of this was in the filename. I was just trying to represent the columns of %track%, %title% and %album%, which I clearly didn't do very well! In the first example all of the albums are blank and the title of track 5 is "Op.4 No.1 in G minor, HWV 289: I. Larghetto e staccato", whereas the title of track 6 is "II. Allegro".

What I want to be able to do is to select a bunch of tracks (in the correct sequence) and apply an Action to each title, if the title matches %piecename%: %movementname%, then set a global variable (say %\_globalvar%) to %piecename%, then set %album% to %\_globalvar% and %title% to %movementname%. If on the other hand the title matches just %movementname%, well as it is in sequence then the %album% must be set to %\_globalvar% and %title% set to %movementname%. So if we have the ability to use a %\_globalvar% like for instance the environmental variables, I would be able to do this, as long as I can both set and get them. I know I can get environmental variables, but I don't know if I can set them.

Thanks for your help!  
Jobasha

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [August 25, 2023, 6:07am UTC](https://community.mp3tag.de/t/applying-information-from-one-file-to-another-based-on-file-sequence/61903/4 "2023-08-25T06:07:51Z")

</div>

If you have files of an album (and only these) grouped together in a folder, then you can use the folder name to fill the album with Convert\>Filename-Tag  
Mask: `%album%\%dummy%`  
If the folder has a different name, then you could use the data from a file that already has the correct data in ALBUM and rename the folder and then apply that folder name to all the files' ALBUM in the folder.

---

<div class="post-metadata">

### Author: ![jobasha](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/13edae/32.png) [@jobasha](https://community.mp3tag.de/u/jobasha)
#### Post date: [August 25, 2023, 6:28am UTC](https://community.mp3tag.de/t/applying-information-from-one-file-to-another-based-on-file-sequence/61903/5 "2023-08-25T06:28:29Z")

</div>

Thanks again!

Unfortunately the folder structure is no good. I think I'll have use python.

Thanks for responding!

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:30pm UTC](https://community.mp3tag.de/t/applying-information-from-one-file-to-another-based-on-file-sequence/61903/6 "2026-02-09T12:30:08Z")

</div>


