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

Automate find and replace

Contributor ,
Nov 12, 2016 Nov 12, 2016

Copy link to clipboard

Copied

I suppose this is a coding question, but I don't know how to code.

I have an InDesign document that has a hard return at the end of every line, and two hard returns between paragraphs.

I need to change those end-of-line returns to spaces, but leave the two returns between paragraphs alone.

I'm getting carpal tunnel trying to do it paragraph-by-paragraph, as this is a full-length book!

Can anyone help?

Thanks!

TOPICS
Scripting

Views

841

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 , Nov 12, 2016 Nov 12, 2016

Hi,

This not a coding question.

Run "Find...Change Text" utility 3 times:

1. Find: "^p^p"     Change: (i.e.) "@@@"

2. Find: "^p"     Change: " "

3. Find: "@@@"     Change: "^p"

Jarek

Votes

Translate

Translate
Mentor ,
Nov 12, 2016 Nov 12, 2016

Copy link to clipboard

Copied

Hi,

This not a coding question.

Run "Find...Change Text" utility 3 times:

1. Find: "^p^p"     Change: (i.e.) "@@@"

2. Find: "^p"     Change: " "

3. Find: "@@@"     Change: "^p"

Jarek

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 ,
Nov 13, 2016 Nov 13, 2016

Copy link to clipboard

Copied

Or with GREP:

Find what: (?<!~b)~b(?!~b)

Change to: one space

Realize that with Jareks and my version, there could be 2 spaces, since there could be a space before the return at the end of the line.

So I would recommend a step 4 (Jareks example) or a step 2 (the grep version)

Find what: \x20{2,}

Change to: nothing

Kai

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
LEGEND ,
Nov 13, 2016 Nov 13, 2016

Copy link to clipboard

Copied

Just be careful!

Capture d’écran 2016-11-13 à 14.29.53.png

(^/)

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 ,
Nov 13, 2016 Nov 13, 2016

Copy link to clipboard

Copied

LATEST

It seems, that (?<!~b)~b doesn’t work in InDesign.

Jean-Claude find out, that e.g. (?<!e)e won’t work too.

bug or logical??

So my idea for the above task is:

Find what: (?<=\S)\x20*\r(?!\s)

Change to: one space

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