Change first instance

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!

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.

1 Like

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.

The function Converter>Filename-Filename 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.

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.

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

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!

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

1 Like

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.

1 Like

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