|P is for Practical|
Sorting a (very) large fileby condar (Initiate)
|on Nov 30, 2007 at 19:14 UTC||Need Help??|
condar has asked for the
wisdom of the Perl Monks concerning the following question:
I'm still a relative Perl newbie, and most of my experience/past projects have been simple parsers. Right now, I have a file listing contained in a file in the following format:
Date (MM-DD-YYYY) \t Time (HH:MM PM) \t Size (in bytes, no formatting) \t Full file path (Directory\filename)
So a sample record would be like:
12-25-2005 12:30 PM 350234 C:\someplace\somefile.txt
What I want to do is sort the list by size, preferably in descending order. I've tried the sort function, and a ST sort, but I get an error on my system that I've run out of memory. This may be because the file I'm using is approximately 400 MB, and I only have 1 GB of memory available.
Any help will be most appreciated. Thank you!
For reference, this is what was used for the last attempt: