Topic: Sort Problem (1 of 7), Read 34 times
Conf: Wildfile, Other macros
From: Ian Binnie
Date: Saturday, March 18, 2006 07:17 PM

Sort Problem.

I was using Sort lines & remove dupes, but it did not seem to be working.

I found I had some lines with `tab'`space'`tab', others with `tab'`tab'.
These display the same, but do not sort.

Try the following, replacing the `tab' with a tab character.

Vedit`tab' `tab'Macro
Vedit`tab'`tab'Macro
Vedit`tab' `tab'Macro
Vedit`tab'`tab'Macro
Vedit`tab' `tab'Macro
Vedit`tab'`tab'Macro

 


Topic: Re: Sort Problem (2 of 7), Read 35 times
Conf: Wildfile, Other macros
From: Christian Ziemski
Date: Sunday, March 19, 2006 03:28 AM

On Sat, 18 Mar 2006 19:17:00 -0500, Ian Binnie wrote:

>Sort Problem.
>
>I was using Sort lines & remove dupes, but it did not seem to
>be working.
>
>I found I had some lines with `tab'`space'`tab', others with
>`tab'`tab'. These display the same, but do not sort.
>
>Try the following, replacing the `tab' with a tab character.
>
>Vedit`tab' `tab'Macro
>Vedit`tab'`tab'Macro
>Vedit`tab' `tab'Macro
>Vedit`tab'`tab'Macro
>Vedit`tab' `tab'Macro
>Vedit`tab'`tab'Macro

Even VEDITs standard Sort() behaves identically.

I assume that is due to this line in the Collate table:
"whitespace: 0 nul, 9 tab, 32 space"

TABs and spaces are considered to be the same.


I'm sure that can be changed by modifying that table, but I don't know
how.


Christian

 


Topic: Re: Sort Problem (3 of 7), Read 37 times
Conf: Wildfile, Other macros
From: Ted Green
Date: Sunday, March 19, 2006 10:46 AM

At 03:29 AM 3/19/2006, you wrote:
>Even VEDITs standard Sort() behaves identically.
>
>I assume that is due to this line in the Collate table:
>"whitespace: 0 nul, 9 tab, 32 space"
>
>TABs and spaces are considered to be the same.
>
>I'm sure that can be changed by modifying that table, but I don't know
>how.

Yes the Collate table controls all this.
The online help topic " Sorting Lines in a File / Block" describes how to modify one of the supplied Collate tables.

Ted.

 


Topic: Re: Sort Problem (4 of 7), Read 35 times
Conf: Wildfile, Other macros
From: Ian Binnie
Date: Sunday, March 19, 2006 05:23 PM

On 3/19/2006 10:46:23 AM, Ted Green wrote:
>At 03:29 AM 3/19/2006, you
>wrote:
>>Even VEDITs standard Sort() behaves identically.
>>
>>I assume that is due to this line in the Collate table:
>>"whitespace: 0 nul, 9 tab, 32 space"
>>
>>TABs and spaces are considered to be the same.
>>
>>I'm sure that can be changed by modifying that table, but I don't know
>>how.
>
>Yes the Collate table controls
>all this.
>The online help topic "
>Sorting Lines in a File /
>Block" describes how to modify
>one of the supplied Collate
>tables.
>
>Ted.
>

I had assumed that this was a collating issue, but did not follow up as fixed my real problem, the insertion of a spurious space.

I agree that equating whitespsce is probably the best default. The issue is the the delete duplicates, which does not work, and probably should use a different collating sequence.

 


Topic: Re: Sort Problem (5 of 7), Read 38 times
Conf: Wildfile, Other macros
From: Ted Green
Date: Sunday, March 19, 2006 08:57 PM

At 05:24 PM 3/19/2006, you wrote:
>I had assumed that this was a collating issue, but did not follow up as fixed my real problem, the insertion of a spurious space.
>
>I agree that equating whitespsce is probably the best default. The issue is the the delete duplicates, which does not work, and probably should use a different collating sequence.

The function is implemented by the sortdupe.vdm macro.

Therefore, by changing the collate table (and setting ustartup.vdm to load your custom collate table) and changing sortdupe.vdm, you should be able to achieve any desired behavior.

Ted.

 


Topic: Re: Sort Problem (6 of 7), Read 38 times
Conf: Wildfile, Other macros
From: Ian Binnie
Date: Monday, March 20, 2006 01:19 AM

On 3/19/2006 8:57:18 PM, Ted Green wrote:
>At 05:24 PM 3/19/2006, you
>wrote:
>The function is implemented by
>the sortdupe.vdm macro.
>
>Therefore, by changing the
>collate table (and setting
>ustartup.vdm to load your
>custom collate table) and
>changing sortdupe.vdm, you
>should be able to achieve any
>desired behavior.
>
>Ted.
Ted,
I know how it works, and have no trouble fixing it.

The issue is ordinary users of Vedit, who may find the Vedit Sort lines & remove dupes command does not work.

Indeed, after looking at the collate sequence & macro, there are other issues.

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

I would do a sort with NOCOLLATE, and include CASE in the Search, possibly doing an ordinary sort after, so it looks OK to the user.

(Sort is a great command.)

 


Topic: Re: Sort Problem (7 of 7), Read 46 times
Conf: Wildfile, Other macros
From: Ted Green
Date: Tuesday, March 21, 2006 01:07 PM

At 01:19 AM 3/20/2006, you wrote:
>Lines that differ only in case are not sorted, but then the search for duplicate line is case insensitive, so it deletes them anyway.

By default, I want a case-insensitive operation. As far as I can tell, lines which differ only in case get deleted, as I want.

A primary use of this macro is to sort email lists.

I suppose the macro could check {CONFIG, Search, Case sensitive} option and
adjust both the Sort() and Search() commands accordingly.

>I would do a sort with NOCOLLATE, and include CASE in the Search, possibly doing an ordinary sort after, so it looks OK to the user.

This seems subjective. Europeans languages prefer umlaut vowels sorted after normal vowels, which requires a Collate table.

Yes, the Tab-versus-Space character sort/collate issue is confusing, but there is no way to please everyone. Hence we have collate tables.

I think the only solution is a more complex macro with a dialog box which allows selecting various options.

Ted.


Ted.
-------------------------------------------------------------------------
Ted Green (ted@...) Greenview Data, Inc.
Web: www.... Fax: 734-996-1308 PO Box 1586, Ann Arbor, MI 48106
Tel: (734) 996-1300 Desk: 734-369-3550 VEDIT - Text/Data/Binary Editor
-------------------------------------------------------------------------
www.SpamStopsHere.com ranked #1 in accuracy by Network Computing Magazine