Special Case: Remove Duplicates TOTALLY, not just one

Find, replace, find in files, replace in files, regular expressions

Special Case: Remove Duplicates TOTALLY, not just one

Postby UltraEditLover » Tue Nov 13, 2007 11:45 pm

I have a file that contains many words.

Suppose:

0x000021E8
0x000021EC
0x000021F0 <DUPLICATE
0x000021F0 <DUPLICATE
0x000021F4
0x00002239
0x00002238 <DUPLICATE
0x00002238 <DUPLICATE

BOTH the duplicates need to be totally removed [not just one]

final result should be:

0x000021E8
0x000021EC
0x000021F4
0x00002239

PLEASE PLEASE help I donot know what to do. :(

In case you'r wondering what those are, these are MIPS addresses and those give me headache. :twisted:
User avatar
UltraEditLover
Newbie
 
Posts: 8
Joined: Tue Nov 13, 2007 12:00 am

Re: Special Case: Remove Duplicates TOTALLY, not just one

Postby Mofi » Wed Nov 14, 2007 9:05 am

User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4051
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Special Case: Remove Duplicates TOTALLY, not just one

Postby UltraEditLover » Wed Nov 14, 2007 8:00 pm

ULTRAEDIT THE BEST! :D

Help:

Can you post the FASTEST version below?
I deal with 669956 lines. It's taking a long time.
I donot need any logs. Also all lines are normal.

and also the MOHI_RULES text not needed but I donot know how to edit the macro.

Thanks!
User avatar
UltraEditLover
Newbie
 
Posts: 8
Joined: Tue Nov 13, 2007 12:00 am

Re: Special Case: Remove Duplicates TOTALLY, not just one

Postby UltraEditLover » Wed Nov 14, 2007 10:06 pm

^^
Request to developers:

The macro takes a long time for even 10000 [i have 669956 lines].

The sort feature is ULTRA-FAST it takes just a few seconds but leaves behind one entry, because it's very optimized unlike the macros, they need to be interpreted.


Could the developers perhaps add an option to totally remove Duplicates option into the Advanced Sort options, Plz? :lol:
User avatar
UltraEditLover
Newbie
 
Posts: 8
Joined: Tue Nov 13, 2007 12:00 am

Re: Special Case: Remove Duplicates TOTALLY, not just one

Postby pietzcker » Thu Nov 15, 2007 7:13 am

If you have UE V12 or higher and use Perl Regular Expressions and check "Regular Expressions" in the "Replace" dialog, then you can use the following search text:
Code: Select all
^(.*)\r\n\1\r\n$
and "replace all" with nothing.

This should be a lot faster than macros.

This only works for duplicates, not triplicates or more.

HTH,
Tim
User avatar
pietzcker
Master
Master
 
Posts: 241
Joined: Sun Aug 22, 2004 11:00 pm

Re: Special Case: Remove Duplicates TOTALLY, not just one

Postby scallanh » Thu Nov 15, 2007 5:45 pm

That's not quite right. This should work (adjust the line endings if it's not a DOS/Windows file, and "replace all" with nothing):

Code: Select all
^(.*\r\n)\1+
User avatar
scallanh
Basic User
Basic User
 
Posts: 31
Joined: Mon Oct 24, 2005 11:00 pm

Re: Special Case: Remove Duplicates TOTALLY, not just one

Postby pietzcker » Thu Nov 15, 2007 9:19 pm

You're right, your regex works for triplicates, and mine doesn't. Yours is also much more elegant. Thanks. I'll edit the offending post...
Tim
User avatar
pietzcker
Master
Master
 
Posts: 241
Joined: Sun Aug 22, 2004 11:00 pm


Return to Find/Replace/Regular Expressions