Skip to main content
Participant
January 23, 2024
Answered

Find and Replace using GREP for $ sign from right to left of 2/3 digit number

  • January 23, 2024
  • 1 reply
  • 427 views

Hello, 

 

Im looking for help making a grep code in the FIND AND REPLACE window that can move all "$000 and" amounts to "000 $". The number changes depending on what the savings amount is, so it can be a 2 digit number or 3 digit number. 

Ex. SAVE $40 to    40 $ DE RABAIS

Ex2. SAVE $150 to    150 $ DE RABAIS

 

Right now i have to manually move the $ sign to the right of all the savings amounts for our English to French translation process and its takes a long time. I looked for grep style examples that would work for this but havent had any luck yet.

This topic has been closed for replies.
Correct answer Robert at ID-Tasker

I'm on my phone so just guessing:

 

(\$)(\d+)

 

$2[space of a kind you want]$1

 

1 reply

Robert at ID-Tasker
Robert at ID-TaskerCorrect answer
Legend
January 23, 2024

I'm on my phone so just guessing:

 

(\$)(\d+)

 

$2[space of a kind you want]$1

 

Joel Cherney
Community Expert
Community Expert
January 24, 2024

Your guess looks correct to me! I would suggest, Lindsey, that what you should want in between your value and your dollar sign is a non-breaking space, as I recall that starting a line with that trailing dollar sign would be incorrect in French typography. So your Change To: line should probably look like

$2~S$1

 

Participant
January 24, 2024

wow thank you so much.

So how would i use the Find and Replace window to find the current state and correct it to this new format? Im a bit confused.

 

Find what: ??

Change to: (\$)(\d+)