Perl Monk, Perl Meditation | |
PerlMonks |
Re: sorting headers in a fileby hdb (Monsignor) |
on Dec 13, 2013 at 07:10 UTC ( [id://1066990]=note: print w/replies, xml ) | Need Help?? |
For the sorting, the file needs to be small enough to be read into memory. If not, I would suggest to make use of some kind of database. In order to split your data into the individual records, you could set the special variable $/ to the value ">or". This way, when you read your file, you get it in the chunks that you need. You would then retrieve the number at the beginning of each chunk (e.g. by regex), sort it, and print it.
In Section
Seekers of Perl Wisdom
|
|