Page 1 of 1

RegEx: Replace repeating lines by single lines

Posted: Wed Dec 11, 2002 1:44 pm
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
--------------------

Re: RegEx: Replace repeating lines by single lines

Posted: Wed Dec 11, 2002 5:56 pm
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)

Re: RegEx: Replace repeating lines by single lines

Posted: Thu Dec 12, 2002 12:00 pm
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

Re: RegEx: Replace repeating lines by single lines

Posted: Wed Dec 25, 2002 5:12 pm
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