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 reply to Re: sorting headers in a file
by hdb
in thread sorting headers in a file
by utpalmtbi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |