LISTSERV mailing list manager LISTSERV 16.0

Help for LINUX-L Archives


LINUX-L Archives

LINUX-L Archives


LINUX-L@LISTS.UFL.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

LINUX-L Home

LINUX-L Home

LINUX-L  2007

LINUX-L 2007

Subject:

Re: Sorting Multiple Columns

From:

Edward Allcutt <[log in to unmask]>

Reply-To:

Platform Independent Linux List! <[log in to unmask]>

Date:

Sun, 2 Dec 2007 20:26:21 -0500

Content-Type:

multipart/signed

Parts/Attachments:

Parts/Attachments

text/plain (29 lines) , signature.asc (29 lines)

On Sun, 2007-12-02 at 20:03 -0500, Mark Oden wrote:
> I have a large dataset that looks similar to this:
>
> 1113531405.073 15577 91 21 12001 0.489 0.092 Complete 2895 80
> 1114032172.486 15577 469 15 7860 0.695 0.089 Complete 2895 80
>
> I would like to sort the data by column 3 followed by sorting by column
> 1. I know using the sort command I can differentiate between which
> column I want to sort by, but I don't know how to sort by one column
> then by another. Any suggestions? Also, are there any other sorting
> programs that use an algorithm other than the one provided by the sort
> program? My data size is 700 MB so I fear it may take awhile and would
> like to use a very efficient algorithm :-)

sort -ns -k 3 -k 1

Adding --buffer-size=700M (or thereabouts) may help as then sort won't
have to keep dynamically adding more memory.

I'm not sure which algorithm sort uses by default, but I wouldn't be
surprised if it were something reasonable like qsort(3).

And 700MB doesn't sound that large to me, just so long as you're not
doing it often in realtime ;)

--
Edward Allcutt <[log in to unmask]>

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

2020
2019
2018
2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997

ATOM RSS1 RSS2



LISTS.UFL.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager