# Feature Request - %\_counter% for Filename-Filename

**URL:** https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965
**Category:** General Discussion
**Created:** [February 23, 2020, 10:33pm UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965 "2020-02-23T22:33:07Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![iUK](https://community.mp3tag.de/user_avatar/community.mp3tag.de/iuk/32/7305_2.png) [@iUK](https://community.mp3tag.de/u/iUK)
#### Post date: [February 23, 2020, 10:33pm UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/1 "2020-02-23T22:33:07Z")

</div>

I would like to rename files sequentially in an order derived from their modified date. I.e. sorting by date, the files would be something like-  
File 1.mp3  
File 2.mp3

I understand I could build an action with a loop and therefore use %\_counter% but then I cannot use the nice 'Filename-Filename' interface with the powerful preview function, such a good way to check for stupid mistakes!

It would be great if the %\_counter% field could just be used in the 'New filename pattern' e.g.-  
%1 %2 %3x$num(%\_counter%,2)

Thanks for a great product btw!

---

<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: [February 24, 2020, 5:33am UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/2 "2020-02-24T05:33:19Z")

</div>

> [@iUK](#):
>
> I understand I could build an action with a loop and therefore use %\_counter%

You can also use the Converter \> Tag-Tag which has a preview.  
After you have used Filename-Filename, use Tag-Tag for \_FILENAME (probably you have to type it in the field name box)  
Format string: %\_filename% %\_counter%

---

<div class="post-metadata">

### Author: ![iUK](https://community.mp3tag.de/user_avatar/community.mp3tag.de/iuk/32/7305_2.png) [@iUK](https://community.mp3tag.de/u/iUK)
#### Post date: [February 24, 2020, 10:40am UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/3 "2020-02-24T10:40:50Z")

</div>

Thanks for the reply ohrenkino, I can see how that would work but I think the format string would be very cumbersome for what I need. I over simplified the example above so here is a more realistic example of what I wish to achieve-

Witness, Series 6, The Time, Part1.mp4  
Witness, Series 6, The Time, Part2.mp4  
Witness, Series 6, Elevation, Part1.mp4  
Witness, Series 6, Elevation, Part2.mp4  
Witness, Series 7, The Later Part, Part1.mp4 etc...

So I have about 50 of these files, which I want to be numbered thus-

Witness 6x01 The Time, Part1.mp4  
Witness 6x02 The Time, Part2.mp4  
Witness 6x03 Elevation, Part1.mp4  
Witness 6x04 Elevation, Part2.mp4  
Witness 7x01 The Later Part, Part1.mp4 etc...

What I would like to do is select a whole series e.g. Series 6 and perform the following Filename to Filename conversion-  
old filename - "%1 %2"  
new filename - "%1 %2 %3x$num(%\_counter%,2) %4"

If I have understood I think it would be cumbersome to split up the %\_FILENAME% string on spaces?

---

<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: [February 24, 2020, 10:54am UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/4 "2020-02-24T10:54:12Z")

</div>

> [@iUK](#):
>
> old filename - "%1 %2"  
> new filename - "%1 %2 %3x$num(%\_counter%,2) %4"

I doubt that you can address 4 pieces for the target filename if you have declared only 2 in the source.

Try Convert\>Tag-Tag for \_FILENAME  
Format string: `$regexp(%_filename%,'(.*), Series (\d+),(.*)',$1 $2x%_counter%$3)`

---

<div class="post-metadata">

### Author: ![Crissov](https://community.mp3tag.de/user_avatar/community.mp3tag.de/crissov/32/6619_2.png) [@Crissov](https://community.mp3tag.de/u/Crissov)
#### Post date: [February 25, 2020, 10:01am UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/5 "2020-02-25T10:01:59Z")

</div>

Aside, why are you not using `%tvseason%` and `%tvepisode%`?

---

<div class="post-metadata">

### Author: ![iUK](https://community.mp3tag.de/user_avatar/community.mp3tag.de/iuk/32/7305_2.png) [@iUK](https://community.mp3tag.de/u/iUK)
#### Post date: [February 25, 2020, 10:50am UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/6 "2020-02-25T10:50:17Z")

</div>

Hi Crissov, thanks for the advice. I was not aware of these tags but having checked how they work I believe I am still faced with the same problem - the files do not have a "tvepisode" value, it is implied from the file created date. I wish to sort the files by this date and then number them sequentially within each "tvseason".

---

<div class="post-metadata">

### Author: ![Crissov](https://community.mp3tag.de/user_avatar/community.mp3tag.de/crissov/32/6619_2.png) [@Crissov](https://community.mp3tag.de/u/Crissov)
#### Post date: [February 25, 2020, 12:57pm UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/7 "2020-02-25T12:57:46Z")

</div>

You can use the track number assistant to fill in `%track%`, copy this (perhaps after `$mod()`) to `%tvepisode%` and `%tvseason%` and then use these tag fields together with others to build new file names.

---

<div class="post-metadata">

### Author: ![iUK](https://community.mp3tag.de/user_avatar/community.mp3tag.de/iuk/32/7305_2.png) [@iUK](https://community.mp3tag.de/u/iUK)
#### Post date: [February 25, 2020, 2:42pm UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/8 "2020-02-25T14:42:08Z")

</div>

Yes, I agree and that is the way I have been doing it. However, these files are over 2Gb in size and it can take up to 1 minute per file, so every 'pass' has the potential of adding hours onto the procedure!

---

<div class="post-metadata">

### Author: ![Crissov](https://community.mp3tag.de/user_avatar/community.mp3tag.de/crissov/32/6619_2.png) [@Crissov](https://community.mp3tag.de/u/Crissov)
#### Post date: [February 25, 2020, 3:54pm UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/9 "2020-02-25T15:54:42Z")

</div>

In my experience, adding an MP4 tag to a large (video) file initially takes considerable time, but updates are rather quick and almost independent of file size.

---

<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: [March 4, 2021, 12:07am UTC](https://community.mp3tag.de/t/feature-request-counter-for-filename-filename/47965/10 "2021-03-04T00:07:27Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
