Eliminate all lines with matching data

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
gcotterl
Posts: 255
Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA

Eliminate all lines with matching data

Post by gcotterl »

My document contains these lines:

AARDVARK
CAT
DOG
DOG
DOG
ELEPHANT
FISH
WOMBAT
WOMBAT
ZYGOTE

Clicking Tools then Sort, ticking the "Delete Duplicate Lines" box and clicking OK results in:

AARDVARK
CAT
DOG
ELEPHANT
FISH
WOMBAT
ZYGOTE

Does TEXTPAD have a way to eliminate all lines with matching data so the result will be:

AARDVARK
CAT
ELEPHANT
FISH
ZYGOTE
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Not easily. But WildEdit does:
Search for: ^(.*\r?\n)\1+

[X] Regular expression
[ ] Matches end of line characters [i.e., not selected]

Replace with: [nothing]
Edit: corrected option settings
gcotterl
Posts: 255
Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA

Eliminate all lines with matching data

Post by gcotterl »

Will TEXTPAD 5.3.1 bookmark the lines containing the same data?
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Do you mean: Is there a way to get TextPad to bookmark every line that is identical to an adjacent line?

Not that I know of. This is a deficiency of TextPad's aged and weak regular expression engine, which is incapable of allowing a back-reference to refer back over a newline.
gcotterl
Posts: 255
Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA

Eliminate all lines with matching data

Post by gcotterl »

Yes, that's exactly what I mean.
Post Reply