sort by column

wayne.lydecker at l-3com.com wayne.lydecker at l-3com.com
Wed Nov 15 17:39:54 CET 2006


Joerg Fischer wrote:
> Scott Woodford wrote:
> 
>> I like the idea, but its not exactly what I had in mind.  I want to do the foll
>> owing:
>>
>> 1. select a section of text to be sorted
>> 2. start the sort_by_column() macro, which waits for a mouse click on a column:
>  
>> define sort_by_column
>> {
>>    pos = my_wait_for_mouse_click_in_window()
>>    col = my_get_column(pos)
>>    filter_selection("sort -k" col)
>> }
>>
>> Is it even possible to wait for a key press or mouse click event during a macro?
> 
> No, but I didn't understand what you had in mind because this task
> should be done in the following way:
> 
> 1. Make a rectangular(!) selection of the column you want to 
>    sort by.
> 
> 2. Start the sort_by_column macro, which is roughly
> 
> 
> define sort_by_column {
>  
>  store $selection_start, $selection_end and $selection_left (= col[umn number])
>  get the line start and end of the line of $selection_start and  _end, respectively
>  now you can select(start, end) the part of the text to be sorted and
>  filter_selection("sort -k" col)
> }
> 
> Cheers,
> Jörg

Pardon me responding to the wrong strand of this thread, but our
corporate spam filters are way over aggressive and I didn't get
the response I want to respond to.

I tried the "sort -k#" method in Shell->Filter, but it ignores
the value I use for #.  It always sorts from the first column.
I'm using the latest RH Enterprise OS and the latest nedit 5.5
downloaded from nedit.org.

Thanks,

-- Wayne.


More information about the Discuss mailing list