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

GREP: removing lines of (nothing) after data merge

Community Expert ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

Hi guys. GREP (sigh)...
I need to remove the empty lines after datamerge for certain products. The checkbox to delete blank lines will not work in this case. I have tried to get the grep correct but to no avail, please can someone help. In my eg i need the "Black" to move up.

thanks

/G

 

Screen Shot 2020-01-22 at 08.54.31.jpg

TOPICS
How to

Views

2.8K
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

Community Expert , Jan 21, 2020 Jan 21, 2020

okay...   it seems that:

 \s+$

works.

Thanks

 

Votes

Translate
Community Expert ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

Hi Grant,

 

In Find Grep, use find what as following

^\r

and leave the change to as blank, this should hopefully work if i understood your requirement properly

 

-Manan

Votes

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 ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

Hi Manan, no that wont work it still would leave the paragraphs that have a tab for instance.

Votes

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
New Here ,
Jul 06, 2023 Jul 06, 2023

Copy link to clipboard

Copied

LATEST

This. Saved. My. Life. Thank you!

Votes

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 ,
Jan 21, 2020 Jan 21, 2020

Copy link to clipboard

Copied

okay...   it seems that:

 \s+$

works.

Thanks

 

Votes

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 ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

Sorry, I thought you just wanted to remove paragraphs that had nothing. However your grep expression will not work in some cases like

  • if the text has something like abc tab tab paragraph your expression will match it which should not be the case as the paragraph does have content abc

I would suggest you to use the following expression

^\s*\r

This will start from the start of the paragraph, make sure either the paragraph is empty or has one or more whitespace characters only and then it is followed by the paragraph end character

 

-Manan

Votes

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 ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

Hi Manan, the problem with that is it assumes the paragraph style from the text above the blank lines. also the \s+$ grep doesnt match the eg you mentioned:

as can be seen here after running the \s+$ grep. Even if there is abc tab tab paragraph.

 

Screen Shot 2020-01-22 at 11.00.55.jpg

 

 

Votes

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 ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

Hi Grant,

 

I think there is some gap in what you and i are doing, please see the screengrab of how i am testing. Notice that using your grep expression the paragraphs with Hello and the other second para is also getting selected. With the expression i gave only the blank para is selected and also i could not reproduce the issue with paragraph style being changed.

https://www.dropbox.com/s/lu7ly4h6r34owk9/screen%20recording%202020-01-22%20at%206.34.01%20pm.mov?dl...

 

-Manan

Votes

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 ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

Hi bud. I watched the vid. and even in your eg only the white space is selected which is perfect. I think a normally written paragraph and using data merge which adds in hidden conditional text may have something to do with it.

 

thanks

Votes

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 ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

Hi Grant,

I suggest you'd make a sample text frame available for testing.

Could be even a IDMS file with Dropbox or a similar service.

 

Thanks,
Uwe Laubender

( ACP )

Votes

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 ,
Jan 22, 2020 Jan 22, 2020

Copy link to clipboard

Copied

Hi Laubender,

the grep i "stumbled" (cause i suck at it) seems to work perfectly for what I am doing so all good for now.

 

thank you

Votes

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