in reply to Re: Re: Sorting big text lists
in thread Sorting big text lists
++, though I tend to disagree regarding references. Your suggestion was to build a hash with original lines as keys, and a specific column as values. To me, that seems inefficient, and no easier to understand. The data is already in a tabular format. The operations we want to do (sorting by a specific column) are easily realized with tabular data. Why not, then, continue to treat the data as a table once it's loaded into memory? The only thing I might do differently here would be to use an AoH (array of hashes) instead of an AoA (array of arrays), thus giving the columns names instead of numbers.
If I am wrong, and the code I presented is actually way over the original poster's head, forgive me. Here are some resources that will help:
|
|---|