• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Find and Replace Price English to French

New Here ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

Hi All

 

I have a Catalogue that I need to create in French as well - previously we went through manually and changed all the price fromatting. But I know there is a way using GREP and variables to automate this.

 

English Pricing format: $39.99 CA
French Pricing format: 52,50 $CA

 

thanks for your help

TOPICS
How to , Scripting

Views

271

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Dec 28, 2022 Dec 28, 2022

Find what: 

(\$)(\d+)\.(\d+)

 

Replace by: 

$2,$3~S$1

 

Note that the ~S means non-breaking space.

Capture d’écran 2022-12-28 à 19.22.39.jpgCapture d’écran 2022-12-28 à 19.22.47.jpg

Votes

Translate

Translate
Community Expert , Dec 28, 2022 Dec 28, 2022

Search: ([$])(\d+).(\d+) (\u\u)

Replace: $2,$3 $1$4

Votes

Translate

Translate
Community Expert ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

Find what: 

(\$)(\d+)\.(\d+)

 

Replace by: 

$2,$3~S$1

 

Note that the ~S means non-breaking space.

Capture d’écran 2022-12-28 à 19.22.39.jpgCapture d’écran 2022-12-28 à 19.22.47.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

thank you

 

could you explain this a little? it's it's saying it can't find any instances of (\$)(\d+)\.(\d+)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

Are you sure that you are in the GREP tab of the search and replace window? Not the text tab?

 

(\$) Dollar sign

(\d+) one or more digits

\. a dot

(\d+) one or more digits

 

$2 what has been found inside the second parenthesis

, a comma

$3 what has been found inside the third parenthesis

~S a non-breaking space

$1 what has been found inside the first parenthesis

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

(looking sheepish) yup - that'll do it. 

 

thanks so much

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

I am sorry, but my English is not good enough to understand your last answer.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

Search: ([$])(\d+).(\d+) (\u\u)

Replace: $2,$3 $1$4

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

Same issue as above, it's not finding any instances of ([$])(\d+).(\d+) (\u\u)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

Are you converting the currency as well as the format? If so, that may require a script instead of a grep.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

no, just the format, thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

\$ finds a dollar sign and distinguish it from grep code, as seen in the replace ($1, etc.) As you can see there are various expressions that ultimately can have the same results. I used [$] with same result.

\d+ finds multiple digits.

Expressions within () treats this as a group that can be moved within the replace.

\u finds capitalized letters.

$1 is the first found group, $2 is the second found group.

 

Look here for more information on GREP

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

thank so much, turns out i was in the wrong area in FIND/REPLACE. this explanation is very helpful - i will look into GREP more fir sure.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 28, 2022 Dec 28, 2022

Copy link to clipboard

Copied

LATEST

turns out i was in the wrong area in FIND/REPLACE

Isn't it what I wrote in my previous message?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines