Sort utility other than SORT.EXE?

Posted: 01-21-2009, 06:23 PM
Hope someone can help with this. I have a comma-delimited text file
with some 200,000 rows. Each row is 186 chars long. I need to have
these rows sorted, and then sent to another file, on both a primary and
a secondary sort. Is there a utility that can do this? The primary
sort needs to be on the last comma-delimited column (position 179-186),
and the secondary sort needs to be on the comma-delimited column that
lies between position 137-150.

I can't think of any way to do this. Thanks for any help.

Sort utility other than SORT.EXE?


Responses to "Sort utility other than SORT.EXE?"

Daniel
Guest
Posts: n/a
 
Re: Sort utility other than SORT.EXE?
Posted: 01-21-2009, 06:28 PM
You can load .txt files into Excel and sort there,
if you are not familiar with this give it a go anyway,
Excel takes care of it all quite intuitively.

regards

Daniel

"Rick" <rick@invalid.net> wrote in message
news:MPG.23e1323ec9c92d9b989a0f@msnews.microsoft.c om...
> Hope someone can help with this. I have a comma-delimited text file
> with some 200,000 rows. Each row is 186 chars long. I need to have
> these rows sorted, and then sent to another file, on both a primary and
> a secondary sort. Is there a utility that can do this? The primary
> sort needs to be on the last comma-delimited column (position 179-186),
> and the secondary sort needs to be on the comma-delimited column that
> lies between position 137-150.
>
> I can't think of any way to do this. Thanks for any help.
Rick
Guest
Posts: n/a
 
Re: Sort utility other than SORT.EXE?
Posted: 01-21-2009, 06:51 PM
Ouch! I figured it was the perfect solution ... until Excel told me
"File not loaded completely". Apparently Excel can't open a file
containing more than 65,536 rows. Hmmm...

In article <u5wtLY$eJHA.3776@TK2MSFTNGP03.phx.gbl>, noone@nowhere.com
says...
> You can load .txt files into Excel and sort there,
> if you are not familiar with this give it a go anyway,
> Excel takes care of it all quite intuitively.
>
> regards
>
> Daniel
>
> "Rick" <rick@invalid.net> wrote in message
> news:MPG.23e1323ec9c92d9b989a0f@msnews.microsoft.c om...
> > Hope someone can help with this. I have a comma-delimited text file
> > with some 200,000 rows. Each row is 186 chars long. I need to have
> > these rows sorted, and then sent to another file, on both a primary and
> > a secondary sort. Is there a utility that can do this? The primary
> > sort needs to be on the last comma-delimited column (position 179-186),
> > and the secondary sort needs to be on the comma-delimited column that
> > lies between position 137-150.
> >
> > I can't think of any way to do this. Thanks for any help.
>
>
Pegasus \(MVP\)
Guest
Posts: n/a
 
Re: Sort utility other than SORT.EXE?
Posted: 01-21-2009, 07:07 PM

"Rick" <rick@invalid.net> wrote in message
news:MPG.23e1323ec9c92d9b989a0f@msnews.microsoft.c om...
> Hope someone can help with this. I have a comma-delimited text file
> with some 200,000 rows. Each row is 186 chars long. I need to have
> these rows sorted, and then sent to another file, on both a primary and
> a secondary sort. Is there a utility that can do this? The primary
> sort needs to be on the last comma-delimited column (position 179-186),
> and the secondary sort needs to be on the comma-delimited column that
> lies between position 137-150.
>
> I can't think of any way to do this. Thanks for any help.
Are you saying that your columns are of fixed width? If so, what is the
starting location and width of each columnn?


Rick
Guest
Posts: n/a
 
Re: Sort utility other than SORT.EXE?
Posted: 01-21-2009, 07:13 PM
Yup, they're fixed width.

The primary sort needs to be on the 'column' that starts at position 179
and is 8 chars wide (this is the last column), and the secondary sort
should start at position 137 and is 13 chars wide.

Thanks for any help.

In article <uHHM8t$eJHA.3728@TK2MSFTNGP06.phx.gbl>, I.can@fly.com.oz
says...
>
> "Rick" <rick@invalid.net> wrote in message
> news:MPG.23e1323ec9c92d9b989a0f@msnews.microsoft.c om...
> > Hope someone can help with this. I have a comma-delimited text file
> > with some 200,000 rows. Each row is 186 chars long. I need to have
> > these rows sorted, and then sent to another file, on both a primary and
> > a secondary sort. Is there a utility that can do this? The primary
> > sort needs to be on the last comma-delimited column (position 179-186),
> > and the secondary sort needs to be on the comma-delimited column that
> > lies between position 137-150.
> >
> > I can't think of any way to do this. Thanks for any help.
>
> Are you saying that your columns are of fixed width? If so, what is the
> starting location and width of each columnn?
>
>
>
Bob I
Guest
Posts: n/a
 
Re: Sort utility other than SORT.EXE?
Posted: 01-21-2009, 07:32 PM
Excel 2007 can do it ;-)

Rick wrote:
> Ouch! I figured it was the perfect solution ... until Excel told me
> "File not loaded completely". Apparently Excel can't open a file
> containing more than 65,536 rows. Hmmm...
>
> In article <u5wtLY$eJHA.3776@TK2MSFTNGP03.phx.gbl>, noone@nowhere.com
> says...
>
>>You can load .txt files into Excel and sort there,
>>if you are not familiar with this give it a go anyway,
>>Excel takes care of it all quite intuitively.
>>
>>regards
>>
>>Daniel
>>
>>"Rick" <rick@invalid.net> wrote in message
>>news:MPG.23e1323ec9c92d9b989a0f@msnews.microsoft .com...
>>
>>>Hope someone can help with this. I have a comma-delimited text file
>>>with some 200,000 rows. Each row is 186 chars long. I need to have
>>>these rows sorted, and then sent to another file, on both a primary and
>>>a secondary sort. Is there a utility that can do this? The primary
>>>sort needs to be on the last comma-delimited column (position 179-186),
>>>and the secondary sort needs to be on the comma-delimited column that
>>>lies between position 137-150.
>>>
>>>I can't think of any way to do this. Thanks for any help.
>>
>>
Rick
Guest
Posts: n/a
 
Re: Sort utility other than SORT.EXE?
Posted: 01-21-2009, 07:40 PM
Aw, don't rub it in :-))

In article <uqUuB8$eJHA.4052@TK2MSFTNGP05.phx.gbl>, birelan@yahoo.com
says...
> Excel 2007 can do it ;-)
>
> Rick wrote:
>
> > Ouch! I figured it was the perfect solution ... until Excel told me
> > "File not loaded completely". Apparently Excel can't open a file
> > containing more than 65,536 rows. Hmmm...
> >
> > In article <u5wtLY$eJHA.3776@TK2MSFTNGP03.phx.gbl>, noone@nowhere.com
> > says...
> >
> >>You can load .txt files into Excel and sort there,
> >>if you are not familiar with this give it a go anyway,
> >>Excel takes care of it all quite intuitively.
> >>
> >>regards
> >>
> >>Daniel
> >>
> >>"Rick" <rick@invalid.net> wrote in message
> >>news:MPG.23e1323ec9c92d9b989a0f@msnews.microsoft .com...
> >>
> >>>Hope someone can help with this. I have a comma-delimited text file
> >>>with some 200,000 rows. Each row is 186 chars long. I need to have
> >>>these rows sorted, and then sent to another file, on both a primary and
> >>>a secondary sort. Is there a utility that can do this? The primary
> >>>sort needs to be on the last comma-delimited column (position 179-186),
> >>>and the secondary sort needs to be on the comma-delimited column that
> >>>lies between position 137-150.
> >>>
> >>>I can't think of any way to do this. Thanks for any help.
> >>
> >>
>
>
Steve Yandl
Guest
Posts: n/a
 
Re: Sort utility other than SORT.EXE?
Posted: 01-21-2009, 07:40 PM
Rick,

I'm really not sure of any size limitations but I think I'd try a vbScript
using a disconnected recordset and the file system object. Here is an
example of a sort that is slightly simpler than your project:
http://www.microsoft.com/technet/scr...8/hey0124.mspx

You will want to assign names to each of the fields (columns). The example
above is sorting on one field only. To expand and sort by two fields, the
two fields should be separated by a single comma with the primary sort field
listed first and both surrounded by a single set of quote marks.


Steve Yandl



"Rick" <rick@invalid.net> wrote in message
news:MPG.23e1323ec9c92d9b989a0f@msnews.microsoft.c om...
> Hope someone can help with this. I have a comma-delimited text file
> with some 200,000 rows. Each row is 186 chars long. I need to have
> these rows sorted, and then sent to another file, on both a primary and
> a secondary sort. Is there a utility that can do this? The primary
> sort needs to be on the last comma-delimited column (position 179-186),
> and the secondary sort needs to be on the comma-delimited column that
> lies between position 137-150.
>
> I can't think of any way to do this. Thanks for any help.

Pegasus \(MVP\)
Guest
Posts: n/a
 
Re: Sort utility other than SORT.EXE?
Posted: 01-21-2009, 08:10 PM
Google is your friend. If you type this into a Google search box

command line sort

then you will immediately trip over this link:
http://www.chmaas.handshake.de/delph...ort/cmsort.htm
Just for fun I sorted a 220,000 line text file with the command below - it
worked very nicely!

cmsort /c=21,10 /c=17,2 d:\input.txt d:\output.txt /b


"Rick" <rick@invalid.net> wrote in message
news:MPG.23e13de2d9280927989a11@msnews.microsoft.c om...
> Yup, they're fixed width.
>
> The primary sort needs to be on the 'column' that starts at position 179
> and is 8 chars wide (this is the last column), and the secondary sort
> should start at position 137 and is 13 chars wide.
>
> Thanks for any help.
>
> In article <uHHM8t$eJHA.3728@TK2MSFTNGP06.phx.gbl>, I.can@fly.com.oz
> says...
>>
>> "Rick" <rick@invalid.net> wrote in message
>> news:MPG.23e1323ec9c92d9b989a0f@msnews.microsoft.c om...
>> > Hope someone can help with this. I have a comma-delimited text file
>> > with some 200,000 rows. Each row is 186 chars long. I need to have
>> > these rows sorted, and then sent to another file, on both a primary and
>> > a secondary sort. Is there a utility that can do this? The primary
>> > sort needs to be on the last comma-delimited column (position 179-186),
>> > and the secondary sort needs to be on the comma-delimited column that
>> > lies between position 137-150.
>> >
>> > I can't think of any way to do this. Thanks for any help.
>>
>> Are you saying that your columns are of fixed width? If so, what is the
>> starting location and width of each columnn?
>>
>>
>>

Tim Slattery
Guest
Posts: n/a
 
Re: Sort utility other than SORT.EXE?
Posted: 01-21-2009, 09:04 PM
Bob I <birelan@yahoo.com> wrote:
>Excel 2007 can do it ;-)
Yes, that limit is gone in Excel 2007. Anybody know whether Open
Office's spreadsheet has a limit like that?

--
Tim Slattery
MS MVP(Shell/User)
Slattery_T@bls.gov
http://members.cox.net/slatteryt
 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort by name doesnt sort correctly in my opinion douglasgblake Windows Vista File Management 5 08-08-2007 02:17 PM
Sort David Hale Mac Office Excel 1 04-29-2004 08:53 PM
sort us out pls Albert Smit Windows XP Messenger 1 02-16-2004 02:21 PM
sort.exe Les Windows XP Help & Support 2 11-13-2003 09:16 AM
Sort.exe Binyamin Dissen Windows XP Basics 1 09-18-2003 09:20 PM