Replace a comma (,) in a group of Artists to a semicolon (;)

Tags: #<Tag:0x00007f58fcca2608> #<Tag:0x00007f58fcca24c8>

Hello there.

Is there a way to replace the commas in the Artist field to semicolons?

I’m new to the forum and I used the search function extensively but I couldn’t find something similar, only for replacing “feat.” on artist names to semicolons. I tried writing a script based in the post’s but whenever I delete “feat” and add a comma I get an error ("Wrong number of arguments.)

$set(artist,$rreplace(%artist%, (comma here),; ))

I’d prefer to replace these commas to semicolons as my music player recognizes that long string of names as an only artist but when these are separated into semicolons each artist is counted independently.

Could you help me sort this out? Much appreciated!

You need to escape the comma (precede it with a backslash) so that Picard doesn’t see it as beginning another argument. See the note in the Scripting section of the documentation for more information.

1 Like

Thank you for the quick response!

I edited my script and it doesn’t seem to work, even though the program doesn’t mention any syntax error. I guess it’s because when editing the Artist field manually all the artists that collaborated in the song are in the same value.

Captura de Pantalla 2021-07-17 a la(s) 7.34.53 p. m.

$set(artist,$rreplace(%artist%, \,,;))

Try removing the leading space before the \, because that is considered part of the search string and is not being found.