Do you need to script this? You can just import that data straight into your favorite spreadsheet and sort by a column or combination of columns, and generate charts while you're there. If you do need to script it, say to separate and pre-sort each month data: just write a custom sort routine and pass the data to the script on STDIN. Hashes could possibly be used, but i doubt they would serve you well...as you are not performing any computation on the data, just sorting it. Besides that, hashes are more suited to data that has unique key indexes....your data does not have any column that can be uniquely indexed. You could combine columns perhaps to create a unique key index, but that would only complicate matters for your sorting.
the hardest line to type correctly is: stty erase ^H