: How can I use GREP in InDesign to swap numbers then nest, then repeat Long time lurker, first time poster! Your tips are really valuable and have taught me what I know till now about GREP,
Long time lurker, first time poster!
Your tips are really valuable and have taught me what I know till now about GREP, thank you!
I have a tricky text to style and I am having some issues, and need your help.
Example text:
2012 Some product name name, State
This is a very impressive young pinot, with tremendous freshness and vitality. Red cherry and spice aromas, fragrant and lifted with hints of coconut and cherry-liqueur. Elegant, medium-weight, fruit-driven and bright, with pinpoint ripeness. Succulent and utterly delicious. It should be long-lived. >1-10 (rating)
96
The text above repeats 50 times with different text, so essentially it's a list of 50 wines.
The resultant text should look like this:
96 # Some product name name, State
This is a very impressive young pinot, with tremendous freshness and vitality. Red cherry and spice aromas, fragrant and lifted with hints of coconut and cherry-liqueur.
Elegant, medium-weight, fruit-driven and bright, with pinpoint ripeness. Succulent and utterly delicious. It should be long-lived. >1-10
2012
Explanation:
2012 needs to move from the start to the end and the number 96 should go to the start. I think this is possible with GREP search but not with GREP style.
I can style the two paragraphs with NESTED styles based on the period.
Using NEXT styles I can repeat it 50 times for each listing.
However, I am having trouble switching the year and the listing number. I want to make it easier for a designer, so that she can use it with minimal number of clicks.
Could you please suggest something easier than using (d{4})(.*)(r|n)(ddrZ) and replacing with etc
More posts by @Eichhorn212
1 Comments
Sorted by latest first Latest Oldest Best
GREP Search and Replace is definitely the simple way to go.
You can set up the expression for the designer once, and InDesign will always remember it and keep it available in the search/replace history. He or she only has to use the dropdown to access the expression. You should also save the search and replace expressions in a text file inside the project folder, in case you need it in the future with some new install of InDesign or on a different system.
One "Change All" and it's done.
If you can predict that there will always be two sentences in the first paragraph, you could even incorporate the paragraph split into the grep expression, which opens up another shortcut:
Rather than style the split paragraphs using nested styles (it's not a best practice to use character styles to style whole paragraphs), use a circular set of "Style" and "Next Style":
Style 1 -- Next Style: Style 2
Style 2 -- Next Style: Style 3
Style 3 -- Next Style: Style 1
Once the grep search/replace has run, your designer simply selects all the text, then right-clicks on Style 1 in the Paragraph Styles panel and chooses Apply Style 1 then Next Style. InDesign formats all the paragraphs based on the sequence of styles that begins with Style 1. This can save many hours of work with repetitively-formatted content in projects like catalogs, directories, price lists and the like.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.