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

GREP search & replace? Or something else?

Enthusiast ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

So I have a long document consisting of company names and booth numbers ordered like this:

company name

booth number

company name

booth number

etc.

The company name and booth number lines are separate paragraph styles.  I want to combine the lines like this

company name    booth number

company name    booth number

I'd put either a tab or an em space between the name and booth number, but they'd be on one line together.

Is there a GREP method of doing that?  I can't think of an obvious way to go about it.  Ideally, I'd change the booth number into a character style so it would still have a different look when it becomes part of the company name paragraph style.

Thanks, Phyllis

Views

406

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

Mentor , Jul 06, 2017 Jul 06, 2017

Step 1. Find what:\r(?=\d{4})

Change to:\t

Step 2. In your 'Company Name' Para style include this GREP:

Apply Style: [your character style for booth number]

To Text:\t\K\d{4}

Your ParaStyle for booth number is obsolete now.

Votes

Translate

Translate
Enthusiast ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

Forgot to mention: The booth number line consists of a number only (4 digits), no text.

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
Mentor ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

Step 1. Find what:\r(?=\d{4})

Change to:\t

Step 2. In your 'Company Name' Para style include this GREP:

Apply Style: [your character style for booth number]

To Text:\t\K\d{4}

Your ParaStyle for booth number is obsolete now.

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
Enthusiast ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

Wow.  I guess that was way way way over my head, but it worked perfectly.  Many thanks!!!  That saves me tons of work.

Much appreciated.

Thanks, Phyllis

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
Mentor ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

LATEST

You're most welcome.

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