# Change first instance

**URL:** <https://community.mp3tag.de/t/change-first-instance/54069>\
**Category:** Support\
**Created:** [August 13, 2021, 7:30pm UTC](https://community.mp3tag.de/t/change-first-instance/54069 "2021-08-13T19:30:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![CaptainCaveman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/5f9b8f/32.png) [@CaptainCaveman](https://community.mp3tag.de/u/CaptainCaveman)\
**Post date:** [August 13, 2021, 7:30pm UTC](https://community.mp3tag.de/t/change-first-instance/54069/1 "2021-08-13T19:30:17Z")

</div>

Hi There,

In my filenames, I need to change the first instance of a dash "-" into a space, dash, space " - " withoit affecting the further dash spacing in the filename.

The current filename structure is something like this 06-Amazing Sing-Song

A simple change of "-" to " - " in the above example would create an unwanted space in Sing-Song to Sing - Song.

Notes - there are always two numbers followerd by a dash and the title without a space. So in theory it could be a regular expression that changes the third character, or the first instance of dash.

Please help guys, really apreciate it!

---

<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 13, 2021, 7:36pm UTC](https://community.mp3tag.de/t/change-first-instance/54069/2 "2021-08-13T19:36:17Z")

</div>

> [@CaptainCaveman](#):
>
> 06-Amazing Sing-Song

You could try Converter\>Filename-Filename  
Source: %1-%2  
Target: %1 - %2

The best way would still be to import the data into the tags first with Converter\>Filename-Tag and then rewrite the filename with Converter\>Tag-Filename.

---

<div class="post-metadata">

**Author:** ![CaptainCaveman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/5f9b8f/32.png) [@CaptainCaveman](https://community.mp3tag.de/u/CaptainCaveman)\
**Post date:** [August 13, 2021, 8:08pm UTC](https://community.mp3tag.de/t/change-first-instance/54069/3 "2021-08-13T20:08:18Z")

</div>

Oh I should say, that the actual tags are fine, they do not contain the numbers and dash, they are perfect. It's just the filename itself. Can you explain the meaning behind the %1 and %2 please I've not gotten my head around the logic of expressions. Thanks again for your input.

---

<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 13, 2021, 8:11pm UTC](https://community.mp3tag.de/t/change-first-instance/54069/4 "2021-08-13T20:11:03Z")

</div>

The function [Converter\>Filename-Filename](https://docs.mp3tag.de/converters/rearrange-filenames) is no regular expression. But it has a preview. So you should see if it works.  
If your tags are ok, then it would be much easier to create new filenames from that data.

---

<div class="post-metadata">

**Author:** ![CaptainCaveman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/5f9b8f/32.png) [@CaptainCaveman](https://community.mp3tag.de/u/CaptainCaveman)\
**Post date:** [August 13, 2021, 8:14pm UTC](https://community.mp3tag.de/t/change-first-instance/54069/5 "2021-08-13T20:14:26Z")

</div>

OK, again thanks for your input. So my tags have no numbers on them at all, I'd need to introduce a two digit number and " - " to each name. I can't help but think it would be better to do

Replace third chracter with " - "

I'll try your other method now though, cheers.

---

<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 13, 2021, 8:16pm UTC](https://community.mp3tag.de/t/change-first-instance/54069/6 "2021-08-13T20:16:25Z")

</div>

> [@CaptainCaveman](#):
>
> So my tags have no numbers on them at all

If you want to import only the number (to get complete tag data) try Converter\>Filename-Tag with  
mask: %track%-%dummy%

---

<div class="post-metadata">

**Author:** ![CaptainCaveman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/5f9b8f/32.png) [@CaptainCaveman](https://community.mp3tag.de/u/CaptainCaveman)\
**Post date:** [August 13, 2021, 8:23pm UTC](https://community.mp3tag.de/t/change-first-instance/54069/7 "2021-08-13T20:23:54Z")

</div>

Ah yes, I don't want numbers in my tag, I only want the filename to have numbers. I think we might be overcomplicating it at this point lol

Your other method worked so far, though I'd like an expression so I can access it quickly from the dropdown.

Thanks ohrenkino!

---

<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 13, 2021, 8:26pm UTC](https://community.mp3tag.de/t/change-first-instance/54069/8 "2021-08-13T20:26:41Z")

</div>

> [@CaptainCaveman](#):
>
> though I'd like an expression

Try an action of the type "Format value" for \_FILENAME  
Format string: `$regexp(%_filename%,(\d+)-(.*),$1 - $2)`

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [August 14, 2021, 11:45am UTC](https://community.mp3tag.de/t/change-first-instance/54069/9 "2021-08-14T11:45:32Z")

</div>

> [@CaptainCaveman](#):
>
> Oh I should say, that the actual tags are fine, they do not contain the numbers and dash, they are perfect. It's just the filename itself.

I wouldn’t think your tags are fine or perfect if they do not contain the track numbers. I would think that only using the track number in the file name is not helpful for most music players that only use the tag data, and ignore the actual file name for the most part.

There are many simple ways to add the track and other tag info you may already have in the file names. For what it takes in storage space for this data, it is very much worth it for consistency and library management. If not for your current use, likely at some point in the future.

---

<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:** [September 13, 2021, 11:45am UTC](https://community.mp3tag.de/t/change-first-instance/54069/10 "2021-09-13T11:45:51Z")

</div>

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