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

GREP : delete word only if they are the last of the line

Explorer ,
Nov 13, 2023 Nov 13, 2023

Copy link to clipboard

Copied

Hi ! 

 

I'm trying to automate the creation of business cards.
For this, I use data merging, then apply GREP commands to finalize, but I have some difficulties with GREP :

When my data merge table has empty boxes, I end up with lines containing only the title (for example: "Tel", "Mel"...) which I want to disappear.

Here is the command I make:
Tel. : \r|Port. : \r|Mél : \r

This works perfectly for the first 2 lines, but not on the last line since there is no paragraph break.
I don't know how to search for "Mél : " specifying that it must be selected only if there is no text on the rest of the line.

Obviously I don't want to delete the title "Mél : " if there is an email address after.

 

Any idea to help me with this ? 🙂

TOPICS
Scripting

Views

173

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

Community Expert , Nov 13, 2023 Nov 13, 2023

Use $ to indicate end of line: Mel$

Votes

Translate

Translate
Community Expert ,
Nov 13, 2023 Nov 13, 2023

Copy link to clipboard

Copied

Use $ to indicate end of line: Mel$

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 ,
Nov 14, 2023 Nov 14, 2023

Copy link to clipboard

Copied

LATEST

Oh ok, thank you ! 

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