EmEditor (text editor) Forum Index Regular Expressions
how to delete duplicate lines | Register To Post |
| Threaded | Oldest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| Yutaka | Posted on: 8/10/2011 4:37 pm |
Webmaster ![]() ![]() Joined: 9/28/2006 From: Redmond Posts: 2401 |
Re: how to delete duplicate lines We are working on such those features in future versions.
Thanks!
|
| Deipotent | Posted on: 8/10/2011 3:50 pm |
Just can't stay away ![]() ![]() Joined: 2/15/2008 From: Posts: 120 |
Re: how to delete duplicate lines Thanks Yutaka, that did the trick!
A new command would be useful, particularly for people who don't scripting or RegEx, as a lot of other Text Editors include a simple menu option for removing duplicates. It would also allow you to highly optimise it, and also include an option to keep the original order (ie. so you don't have to sort it first), which would be useful. One of my other suggestions was for a simple RegEx library feature, so you can create or import Regex's with a name, optional description, and possibly find settings. This would allow you to select the relevant regex from the library list and then run it. |
| Yutaka | Posted on: 8/10/2011 1:11 pm |
Webmaster ![]() ![]() Joined: 9/28/2006 From: Redmond Posts: 2401 |
Re: how to delete duplicate lines In EmEditor \r is ignored, so you should try using this?
In future versions, I might add a new command to remove duplicate lines, so you won't need to use regular expression replace in the future. Thanks!
|
| Deipotent | Posted on: 8/10/2011 12:21 pm |
Just can't stay away ![]() ![]() Joined: 2/15/2008 From: Posts: 120 |
Re: how to delete duplicate lines I needed this functionality recently and thought it could be done easily with regex. Google led me to http://www.regular-expressions.info/duplicatelines.html which said to sort the lines, and then search for the following:
and replace with: Unfortunately, I couldn't get this to work in EmEditor, even after enabling the option to search past line boundaries. Can you add support for this type of regex to EmEditor ? PS. I haven't tried the macro yet, and am sure it works fine, but it would be nice if it could be done with regex. |
| raikrivera | Posted on: 7/28/2011 1:36 am |
Just popping in ![]() ![]() Joined: 7/28/2011 From: USA Posts: 1 |
Re: how to delete duplicate lines Thank you sooooo much guys which i was searching for it.
|
| Monkeyman | Posted on: 6/5/2011 12:47 pm |
Just popping in ![]() ![]() Joined: 9/3/2009 From: Posts: 3 |
Re: how to delete duplicate lines Thank you for good macro. Removing duplicate lines is very nice and useful feature, which EmEditor lacks badly. I hope you'll add it in future release.
As for JS macro provided, it has one small "glitch". When duplicate line is the last one this macro doesn't recognize it. For example: Badger Eagle Simpsons Donkey Badger There's no new line after second "Badger", so it won't delete it. |
| Salabim | Posted on: 1/5/2010 11:07 pm |
Quite a regular ![]() ![]() Joined: 9/5/2009 From: Ghent (Belgium) Posts: 58 |
Re: how to delete duplicate lines Thanks a lot Yutaka ! :)
|
| Yutaka | Posted on: 1/4/2010 9:51 pm |
Webmaster ![]() ![]() Joined: 9/28/2006 From: Redmond Posts: 2401 |
Re: how to delete duplicate lines Then how about this?
|
| Salabim | Posted on: 1/3/2010 10:33 am |
Quite a regular ![]() ![]() Joined: 9/5/2009 From: Ghent (Belgium) Posts: 58 |
Re: how to delete duplicate lines Hi Yutaka,
regarding the last (faster) duplicate line macro you posted, is it possible to change the code so that the last line... ... could actually show how many duplicate lines were deleted ? Something like : "117 duplicate lines deleted." |
| Yutaka | Posted on: 4/18/2009 1:26 pm |
Webmaster ![]() ![]() Joined: 9/28/2006 From: Redmond Posts: 2401 |
Re: how to delete duplicate lines Quote:
I did some optimization. Please try this. This also shows the current status on the status bar.
|
| (1) 2 » | |
| Threaded | Oldest First | Previous Topic | Next Topic | Top |
| Register To Post | |







