RegEx: Replace repeating lines by single lines

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Peter

RegEx: Replace repeating lines by single lines

Post by Peter »

I know, this is perhaps not the right place, but I guess there are some experts around ...
Given is a wordlist like the following:
--------------------
Imblemendierung
Inderned
Inderned
Inderned
Inderned
Indernedaufdridd
Indernedaufdridd
Indernedrechd
Indernedseidn
Informadion
Informadionssausdausch
--------------------

Which RegEx is able to replace repeating lines by a single line?
The result for the above should look like this:
--------------------
Imblemendierung
Inderned
Indernedaufdridd
Indernedrechd
Indernedseidn
Informadion
Informadionssausdausch
--------------------
Ed

Re: RegEx: Replace repeating lines by single lines

Post by Ed »

Is this a sorted list? If so then use Tools->Sort->Delet Duplicate lines
If not then it is possible - (see elsewhere in this forum or repost)
Andreas

Re: RegEx: Replace repeating lines by single lines

Post by Andreas »

Allmechd, ä Franggä ;-)

First, replace all \n by @@@ (or any other string not occurring in the file.
Search for
^\(.*\)@@@\1$
Replace by
\1
Now, replace all @@@ by \n
Ken Carlson

Re: RegEx: Replace repeating lines by single lines

Post by Ken Carlson »

How do you set up a TextPad macro? I have some text in which
I want to substitute spaces with tabs so I will have several columns of data.
What steps in TextPad do I follow to accomplish this task?
thanks
Post Reply