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

InDesign GREP code to move prices

New Here ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Question for the group regarding GREP. I need to move the price of multiple items on a menu from the item to the description (See below) using a GREP code. I was able to create one a few years ago, but I can't get it to work any more. Any help is great ly appreciated!

 

Exaple:

Turn this: 

 

Club Sandwich 6.99
Bacon, Lettuce, Tomatoes, Mayonnaise on Toast

 

Into this: 

 

Club Sandwich 
Bacon, Lettuce, Tomatoes, Mayonnaise on Toast 6.99

TOPICS
How to , Scripting

Views

273

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 1 Correct answer

Community Expert , Apr 21, 2021 Apr 21, 2021

Try this...
Find:

(.+)\h(\d+\.\d\d)\r(.+)\r

Change to:

$1\r$3\s$2\r


 

Votes

Translate

Translate
Community Expert ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Try this...
Find:

(.+)\h(\d+\.\d\d)\r(.+)\r

Change to:

$1\r$3\s$2\r


 

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
Guide ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Hi JC,

 

Not truly good for 2 reasons:

 

• you forget an eventual end of story;

• if the first para uses a para style and the following another different one, …

 

This regex is simpler and doesn't encounter these 2 issues:

 

(\h[\d.]+)(\r.+$)

$2$1

 

(^/)  The Jedi

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 ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

It’s good, but not always! 😉

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 ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

LATEST

This is awesome. Both of them work great for what I need.

 

Thank you both 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