Replace term with brackets

Hi again, I was having a problem using the $replace function. I had an existing track as:

Let It Grow (San Francisco CA, Winterland Arena, February 2nd 1974)

I want to select all tracks, Convert → Tag - Tag…

I want to change:

(San Francisco CA, Winterland Arena, February 2nd 1974) to

(San Francisco CA, Winterland Arena, February 22nd 1974)

But, I have a space character before the first “(“ both on what is there and what I want to replace with. The syntax seems to be perl like and I was not sure if I should double quote the strings and do I have to escape the “(“ and “)”, should I have a space after the , ?

I tried:

$replace(%title%,(San Francisco CA, Winterland Arena, February 2nd 1974),(San Francisco CA, Winterland Arena, February 22nd 1974))

I was not sure if putting a space after the comma affects things (or do I need quotes):

$replace(%title%, “ (San Francisco CA, Winterland Arena, February 2nd 1974)”, “ (San Francisco CA, Winterland Arena, February 22nd 1974)”)

If this were some code I were writing I would naturally put a space after the commas to help separate the parameters as I have it above.

Could you tell me what would be the full correct syntax for the above?

I had:

Let It Grow (San Francisco CA, Winterland Arena, February 2nd 1974)

And want:

Let It Grow (San Francisco CA, Winterland Arena, February 22nd 1974)

There is one space before the ( and no space after the )

Thanks for you help with this. (This was just one track, I wanted to select all and apply the same replace operation to all.)

To escape special characters like brackets in format strings, use the apostrophe:
$replace(%title%, ' (San Francisco CA, Winterland Arena, February 2nd 1974)', ' (San Francisco CA, Winterland Arena, February 22nd 1974)')
Yet, I wonder: if it is just " 2nd" that needs to be replaced with " 22nd" - why don't you reduce the search and replace terms to avoid the brackets ...?

To remove leading (or trailing) spaces you could use the $trim functions:

$trim(x,c) trims all leading and trailing whitespace from the string x. The optional second parameter c specifies the character to trim.
$trimLeft(x,c) trims all leading whitespace from the string x. The optional second parameter c specifies the character to trim.
$trimRight(x,c) trims all trailing whitespace from the string x. The optional second parameter c specifies the character to trim.

To change 2nd to 22nd I would use a simple $replace

$replace(x,y,z) returns the string x with all occurrences of string y replaced by string z. Supports multiple parameter pairs y and z.

Yes, I guess I could’ve done that. But I’m glad to know it’s single quotes to solve this. Thank you.

I have a serious problem with this post. There was no “Let It Grow” on Feb 2. The first performance of LIG in 1974 was Feb 22 (also 23rd, 24th).

:grinning_face_with_smiling_eyes: :grinning_face_with_smiling_eyes: :grinning_face_with_smiling_eyes: :high_voltage:

PS: My first Dead concert, 5-25-74 UCSB, had a Let It Grow!

Exactly! That’s why I needed to get this fixed asap! :wink: (Whole point of problem - change 2nd to 22nd)

Is there a special reason why you wanted to do this simple task with the converter instead of just editing the title field and change "2" to "22"?

If you read the beginning of the thread you’ll can see why. I was simply trying to use replace and there are about 25 tracks with this same error, seems like using replace would be easier/faster???