Topic: A simple Sort_Merg question. (1 of 7), Read 34 times
Conf: Search and Replace
From: Peter Rejto
Date: Wednesday, May 24, 2006 12:34 PM

Hi,

I would like to sort a file, lines 6 through 60,
first on columns 10 through 12 and then on columns 1-through 8. I used the following command:

Sort_Merge("10:12;1:8",6,60)

I do not get an error message and I do not get gthe desiored result either.


What do I do wrong ?


Thanks,

-peter.

 


Topic: Re: A simple Sort_Merg question. (2 of 7), Read 33 times
Conf: Search and Replace
From: Christian Ziemski
Date: Wednesday, May 24, 2006 12:54 PM

On Wed, 24 May 2006 00:34:00 -0400, Peter Rejto wrote:

>I would like to sort a file, lines 6 through 60,
>first on columns 10 through 12 and then on
>columns 1-through 8.
>I used the following command:
>
>Sort_Merge("10:12;1:8",6,60)
>
>I do not get an error message and I do not get gthe desiored result either.

Peter:

The p and q in the command Sort_Merge("keyfield-list",p,q) are file positions and not
line numbers.

You can do it for example this way:


Goto_Line(6)
#103=Cur_Pos

Goto_Line(60+1)
#104=Cur_Pos

Sort_Merge("10:12;1:8",#103,#104)



Christian

 


Topic: Re: A simple Sort_Merg question. (3 of 7), Read 28 times
Conf: Search and Replace
From: Fritz Heberlein
Date: Wednesday, May 24, 2006 01:13 PM

vtech-search-replace Listmanager schrieb:
> Sort_Merge("10:12;1:8",6,60)
>
> I do not get an error message and I do not get gthe desiored result either.

Peter,

a simple sort like that is IMHO much easier to do by using EDIT / sort
and specifying the desired options there (don't forget to mark the
appropriate lines as block!).

Regards,

Fritz

 


Topic: Re: A simple Sort_Merg question. (7 of 7), Read 21 times
Conf: Search and Replace
From: Peter Rejto
Date: Thursday, May 25, 2006 11:10 AM

On 5/24/2006 1:13:17 PM, Fritz Heberlein wrote:
>vtech-search-replace
>Listmanager schrieb:
>> Sort_Merge("10:12;1:8",6,60)

>a simple sort like that is
>IMHO much easier to do by
>using EDIT / sort
>and specifying the desired
>options there (don't forget to
>mark the
>appropriate lines as block!).


Thanks Fritz,

Somehow I missed the EDIT/sort family of Menu Commands.

Now I see that it is based on the Sort_Merge Vedit Macro Command. So, it is much easier to to use it than to reprogram it on my own.

I learned something interesting!

-peter.

 


Topic: Re: A simple Sort_Merg question. (4 of 7), Read 31 times
Conf: Search and Replace
From: Ted Green
Date: Wednesday, May 24, 2006 04:24 PM

At 12:35 PM 5/24/2006, you wrote:
>I would like to sort a file, lines 6 through 60,
>first on columns 10 through 12 and then on columns 1-through 8. I used the following command:
>
>Sort_Merge("10:12;1:8",6,60)
>
>I do not get an error message and I do not get gthe desiored result either.

The Sort_Merge() command only works with file positions, not with line numbers.

Ted.

 


Topic: Re: A simple Sort_Merg question. (5 of 7), Read 34 times
Conf: Search and Replace
From: Peter Rejto
Date: Thursday, May 25, 2006 01:34 AM

On 5/24/2006 4:24:07 PM, Ted Green wrote:
>At 12:35 PM 5/24/2006, you
>wrote:
>>I would like to sort a file, lines 6 through 60,
>>first on columns 10 through 12 and then on columns 1-through 8. I used the following command:
>>
>>Sort_Merge("10:12;1:8",6,60)

>The Sort_Merge() command only
>works with file positions, not
>with line numbers.



Gentlemen:

A BIG THANK YOU TO ALL THREE OF YOU!


After you put me on the right track, I realized that my problem came from a Simple typo. So, my macro got hung up at the beginning.

I did succeed in making a simple adaptation of the ddir example of the On-line Help. Now I can sort a directory by extension and name. The output is similar to the output of the old DOS, DIR /Oen, output. (Something I tried to replicate in Windows, but could not.) To my mind, it illustrates the power of the dir_date() Vedit command!

I shall try to upload my macro:


Thanks again,

-peter

 


Topic: Re: A simple Sort_Merg question. (6 of 7), Read 33 times, 1 File Attachment
Conf: Search and Replace
From: Peter Rejto
Date: Thursday, May 25, 2006 01:43 AM

Oops,

I had trouble with the upload. I try again,

 
Adaptation of ddir example of Help