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

How to Find\Change 2 things into 1, in one action

Explorer ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

Hi,

I want to change any multiple spaces and any tabs, to a single space.

the GREP code for multiple spaces is "  +" and for tab is "^t", there is any way to combine these in a single GREP line, or I need to do 2 separate actions?

To make the question simple: How can I find and change the letters "A" and "B", to "C" in one action?

There is a code that combine characters? Something like this?

Capture.PNG

Thanks a lot!

Haim

Views

1.4K

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

Explorer , Aug 06, 2017 Aug 06, 2017

Okay, I found it - thanks to your help:

^[\t ]+

dfgdfgdfg.PNG

Thanks again guys!

Votes

Translate

Translate
Mentor ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

In F/C dialog GREP tab:

Find what:

\h+

Change to:

\s

This will change any combination of horizontal space(s) (incl. tabs) into one single 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
Community Expert ,
Aug 02, 2017 Aug 02, 2017

Copy link to clipboard

Copied

The code for a single tab is not ^t -- that is the code for a tab in the regular Find/Change, not in GREP. The proper code for a tab is \t.

To combine several possible characters into one 'find' code, use a Character Set: [xyz] will look for one of 'x', 'y', or 'z'. You can also include predefined sets into this, so [\u1] will look for any single uppercase character OR the digit '1'. Your example for 'A' and 'B' would be

[AB]

and for 'any space OR any tab' you'd use

[\t ]

(where there is a space before the end ]).

See the online help for more about the supported GREP codes: Find/Change text in InDesign

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
Explorer ,
Aug 06, 2017 Aug 06, 2017

Copy link to clipboard

Copied

Thanks a lot guys,

winterm - it didn't work for me. I'm working on CS5, if it matters.

Jongware - I need to replace all the spaces and tabs that founds at the beginning of a paragraph, with nothing (delete them).

dfgdfgdfg.jpg

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 ,
Aug 06, 2017 Aug 06, 2017

Copy link to clipboard

Copied

^\h+

(^/)

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
Explorer ,
Aug 06, 2017 Aug 06, 2017

Copy link to clipboard

Copied

Okay, I found it - thanks to your help:

^[\t ]+

dfgdfgdfg.PNG

Thanks again guys!

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
Community Expert ,
Aug 06, 2017 Aug 06, 2017

Copy link to clipboard

Copied

Obi's ^\h+ will find any white space, (i.e., non breaking spaces, en space, em space, etc.).

^[\t ]+ will only find tabs and multiple normal spaces, so below it would find the space in front of paragraph 1 but not paragraph 2

Screen Shot 2017-08-06 at 8.52.38 AM.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
Explorer ,
Aug 06, 2017 Aug 06, 2017

Copy link to clipboard

Copied

LATEST

Thanks,

For me - ^[\t ]+ found all the multiple spaces and tabs at the beginning of every paragraph in the document, and remove them. that's what i needed.

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