Topic: Enhancements for SORTDUPE and SORTLENGTH (1 of 4), Read 46 times
Conf: VEDIT Beta Test
From: Christian Ziemski
Date: Friday, July 07, 2006 11:57 AM


Please let me be the second one breaking the World Cup silence here...


The "What's new" of VEDIT 6.15 says

(1)
New {EDIT, Sort, Sort lines & remove dupes} performs a simple sort of all lines in a file (or highlighted block). After sorting, all duplicate lines are deleted from the file.

(2)
New {EDIT, Sort, Sort lines by length} sorts the entire file by the length of the lines.


And the short info in the status line reads:

(3) "Sort lines and remove duplicate lines"
(4) "Sort lines in file (or block) by length"


Unfortunately the underlying macros doesn't exactly do that.

- The former one restricts the sort to a highlighted block but removes dupes always in the whole file.

- The latter one doesn't work on blocks at all, only on the whole file.


So I fixed/enhanced both macros:

http://www.ziemski.net/vedit/macros/sortlength.vdm
http://www.ziemski.net/vedit/macros/sortdupe.vdm

and would suggest adding a "(or block)" to the lines of (1), (2) and (3) above.

Both new macros need some additional testing. Please.


Christian

 


Topic: Enhancements for SORTDUPE and SORTLENGTH (2 of 4), Read 44 times
Conf: VEDIT Beta Test
From: Ian Binnie
Date: Saturday, July 08, 2006 04:51 AM

On 7/7/2006 11:57:03 AM, Christian Ziemski wrote:
>
>(1)
>New {EDIT, Sort, Sort lines &
>remove dupes} performs a
>simple sort of all lines in a
>file (or highlighted block).
>After sorting, all duplicate
>lines are deleted from the
>file.
>
>Unfortunately the underlying
>macros doesn't exactly do
>that.
>
>- The former one restricts the
>sort to a highlighted block
>but removes dupes always in
>the whole file.

Not only that, but it deletes lines that are NOT duplicates.
"Lines that differ only in case are not sorted, but then the search for duplicate line is case insensitive, so it deletes them anyway."

see:-
http://webboard.vedit.com/read?21186,40e#21186

 


Topic: Re: Enhancements for SORTDUPE and SORTLENGTH (4 of 4), Read 29 times
Conf: VEDIT Beta Test
From: Ted Green
Date: Wednesday, January 16, 2008 01:07 PM

At 03:51 AM 7/8/2006, you wrote:
>Not only that, but it deletes lines that are NOT duplicates.
>"Lines that differ only in case are not sorted, but then the search for duplicate line is case insensitive, so it deletes them anyway."
>
>see:-
>http://webboard.vedit.com/read?21186,40e#21186

I did not address this, as it comes down to personal preferences. Since many people use this to sort email lists, we would want to delete lines that differ only in case.
It would require a macro with dialog box options to fully handle everything.

Ted.

 


Topic: Re: Enhancements for SORTDUPE and SORTLENGTH (3 of 4), Read 25 times
Conf: VEDIT Beta Test
From: Ted Green
Date: Wednesday, January 16, 2008 01:00 PM

At 11:02 AM 7/7/2006, you wrote:
>The "What's new" of VEDIT 6.15 says
>
>(1)
>New {EDIT, Sort, Sort lines & remove dupes} performs a simple sort of all lines in a file (or highlighted block). After sorting, all duplicate lines are deleted from the file.
>
>(2)
>New {EDIT, Sort, Sort lines by length} sorts the entire file by the length of the lines.
>
>
>And the short info in the status line reads:
>
>(3) "Sort lines and remove duplicate lines"
>(4) "Sort lines in file (or block) by length"
>
>
>Unfortunately the underlying macros doesn't exactly do that.
>
>- The former one restricts the sort to a highlighted block but removes dupes always in the whole file.
>
>- The latter one doesn't work on blocks at all, only on the whole file.
>
>
>So I fixed/enhanced both macros:
>
>http://www.ziemski.net/vedit/macros/sortlength.vdm
>http://www.ziemski.net/vedit/macros/sortdupe.vdm
>
>and would suggest adding a "(or block)" to the lines of (1), (2) and (3) above.

I have incorporated the new macros with a few cosmetic changes.
And updated the on-line help and status line messages.

Thank you.

Ted.