is now part of CreativePro.com!

Tip of the Week: Reordering Paragraphs With GREP

3

This tip was sent to Tip of the Week email subscribers on October 30, 2014.

InDesignSecrets Tip of the Week

Sign up now and every week you’ll get a new InDesign Tip of the Week and Keyboard Shortcut of the Week, along with roundups of new articles at InDesignSecrets and CreativePro, plus exclusive deals sent right to your Inbox!

Just scroll all the way down to the bottom of this page, enter your email address, and click Go! We’ll take care of the rest. Now, on with the tip!


Ever have a sequence of paragraphs that you needed to put in a different order? If it’s just one or two paragraphs, you could copy and paste. But what if you need to make the same change dozens, or even hundreds of times? In that case, it’s time to use a little GREP Find/Change. The key is to use the Found Text expression.

Here’s a sequence of paragraphs of contact information.

20141030-totw2

Say you needed to rearrange the last two paragraphs so the email address comes before the Twitter handle. No problem.

Open the Find/Change dialog box and click on the GREP tab. In Find What, search for a sequence of five paragraphs using the expression, one or more of any character, followed by an end of paragraph .+\r 

Enter this five times and put each one in parentheses to group them into separate sub-expressions.

20141030-totw3

Now rearrange the sub-expressions by replacing them with the code for Found Text 1-5, indicated by dollar sign plus the number. And simply put the fifth found item $5before the fourth $4.

20141030-totw4

Run the find/change and voila, the information is reordered.

20141030-totw5

The one “gotcha” you have to be careful of is that GREP find/change will mess up any text formatting you have applied to individual words or paragraphs. So you should do this before you apply formatting!

Editor in Chief of CreativePro. Instructor at LinkedIn Learning with courses on InDesign, Illustrator, Photoshop, GIMP, Inkscape, and Affinity Publisher. Co-author of The Photoshop Visual Quickstart Guide with Nigel French.
  • mw says:

    I was playing with this and the first set of information worked, but not the second set. Am I missing something? It’s reading lines 1-5, but missing the rest.

  • DIONISIA says:

    Hello i’m a designer from greece & i’d like to know more about inDesign’s Styles could you please give me some tips?

  • >