Greetings all,
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:
@in = <INPUTFILE>; @out = map $_->[0] => sort { $a->[1] <=> $b->[1] } map [$_, (split(/\t/))[2]] => @in;
In reply to Sorting a (very) large file by condar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |