Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting Problem



At 15:43 -0800 01/21/2004, Sean Ahern wrote:
>Dave Taflin wrote:
>> For grins, have you tried shell commands?
>>
>> cat unsorted.txt | sort > sorted.txt
>
>Unneeded "cat".  That should probably be:
>
>    sort +0.0 +0.10 +0.20 unsorted.txt > sorted.txt
>
>to sort by columns 0, 10, and 20.
>
>However, I don't think you'd want to pull all 2G of text data into memory
>for the sort.  I would very much doubt if UNIX sort does out-of-core
>processing, which is what you really want for this sort (heh) of thing.

Actually it does a "radix" sort using files in the /tmp directory.   You are limited by disk space not RAM.  It won't kill you by thrashing the VM.  Go for the sort command.  But make sure you have at least 4 GB of free disk space to sort a 2GB file.

>You'd kill your computer with swapping.

Nope.  Read the man page for "sort" there are a LOT of options.

-Scott
-- 
         Dr. Scott Hannahs, Head of User Research Instrumentation
                     http://sthmac.magnet.fsu.edu
     National High Magnetic Field Laboratory, Florida State University
 1800 E. Paul Dirac Dr., Tallahassee FL 32310, (850)644-0216/FAX 644-0534

"Claiming that the Macintosh is inferior to Windows because most people use Windows, is like saying that all other restaurants serve food that is inferior to McDonalds."
_______________________________________________
scitech mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech
Do not post admin requests to the list. They will be ignored.

References: 
 >RE: Sorting Problem (From: "Dave Taflin" <email@hidden>)
 >Re: Sorting Problem (From: Sean Ahern <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.