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

110

Likes

translate

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

Advocate , Apr 21, 2021 Apr 21, 2021
Try this...Find: (.+)\h(\d+\.\d\d)\r(.+)\r Change to: $1\r$3\s$2\r  

Likes

translate

Translate

Translate
Advocate ,
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


 

Likes

translate

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
Advocate ,
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

Likes

translate

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

Copy link to clipboard

Copied

It’s good, but not always! 😉

Likes

translate

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

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

 

Thank you both so much!

Likes

translate

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