# Numbering a tagfield from 1 to 7 repeatedly

**URL:** https://community.mp3tag.de/t/numbering-a-tagfield-from-1-to-7-repeatedly/11031
**Category:** Support
**Created:** [October 30, 2010, 1:20pm UTC](https://community.mp3tag.de/t/numbering-a-tagfield-from-1-to-7-repeatedly/11031 "2010-10-30T13:20:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Michiel](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@Michiel](https://community.mp3tag.de/u/Michiel)
#### Post date: [October 30, 2010, 1:20pm UTC](https://community.mp3tag.de/t/numbering-a-tagfield-from-1-to-7-repeatedly/11031/1 "2010-10-30T13:20:42Z")

</div>

I would like to write value X in a tagfield of subsequent mp3 files of a folder with 10.000 mp3 files while:  
At start X=0  
If X ≠ 7 then X = X+1  
else X=1  
In case I can achieve this with MP3 tag, how?  
Michiel

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [October 30, 2010, 1:44pm UTC](https://community.mp3tag.de/t/numbering-a-tagfield-from-1-to-7-repeatedly/11031/2 "2010-10-30T13:44:36Z")

</div>

> [@Michiel](#):
>
> I would like to write value X in a tagfield of subsequent mp3 files of a folder with 10.000 mp3 files while:  
> At start X=0

It can be achieved with %\_counter% and some boolean and arithmetic functions: [https://docs.mp3tag.de/scripting/#boolean-functions](https://docs.mp3tag.de/scripting/#boolean-functions)

if you use just %\_counter%, start would be at 1  
$sub(%\_counter%,1) starts with 0

> [@](#):
>
> If X ≠ 7 then X = X+1  
> else X=1

$if($eql(%\_counter%,7),1,%\_counter%)  
did I understand you right? strange numbering...

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 30, 2010, 2:00pm UTC](https://community.mp3tag.de/t/numbering-a-tagfield-from-1-to-7-repeatedly/11031/3 "2010-10-30T14:00:12Z")

</div>

Numbering a tagfield from 1 to 7 repeatedly.  
_Actiontype 5:_ **Format value**  
_Field:_ **COUNTER**  
_Formatstring:_ **$add($mod($sub(%\_COUNTER%,1),7),1)**

DD.20101030.1800.CEST

---

<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:22pm UTC](https://community.mp3tag.de/t/numbering-a-tagfield-from-1-to-7-repeatedly/11031/4 "2026-02-09T12:22:39Z")

</div>


