Skip to main content
Inspiring
June 30, 2022
Answered

Simple GREP deletion of lines

  • June 30, 2022
  • 11 replies
  • 1464 views

I'd need a simple find and delete duplicate lines for a 16K items column.

VARIABLE NUMBERS(\t)PAGE NUMBER\p)

 

Thank you for help

This topic has been closed for replies.
Correct answer Gioyer07

Solution (for newbies like me) has to follow these steps

1) clean the document from spaces, tabs etc. (use show hidden characters).

2) apply grep

find

^(.+\r)\1+
replace
$1

11 replies

Barb Binder
Community Expert
Community Expert
June 30, 2022

Hi @Gioyer07:

 

GREP is pattern-based. It looks like your pattern is:

a series of numbers, a tab, more numbers and a hard return.

 

If these are the only paragraphs in the file that follow that pattern, use:

 

Find what: \d+\t\d+\r

Change to:

 

Save the file first!

 

~Barb

~Barb at Rocky Mountain Training
Gioyer07Author
Inspiring
July 1, 2022

Thank you Barb

My attempts to use your syntax failed. It probably is my fault because I failed to describe better the text I need to clean.

It has this structure:

011101850 17
011101850 17
011102250 17

The same three lines look in the finder as in the picture:

I really appreciate your help. Thank you.