0

With Find/Replace or GREP I want to do the following:

Delete the whole paragraph in which there is the string "XXX".

It's not that hard I think to do but I seem to be unable to find the solution online.

Thanks!

It's for a Data Merge in InDesign where there is data sets that are included each in individual paragraphs. For those that are empty the whole paragraph should be inexistent. Since this can't be automated with Data Merge by itself, I want to at least to it with only one additional find/replace action.

This is an example line:

Here is random text TAB XXX m2

The part with "Here is random text" is the variable part. Then there is a tab and then m2.

So I need something like this with additional code where the empty spaces are:

     ^tXXX m2
Thomas Maier
  • 181
  • 1
  • 13

2 Answers2

0

To delete a line with XXX

sed '/XXX/d' file
Jotne
  • 40,548
  • 12
  • 51
  • 55
0

I found the solution myself. Here it is:

^.+XXX m2\r

Put that in the Find field in the GREP dialog in Indesign and leave the Replace field empty.

Thomas Maier
  • 181
  • 1
  • 13