I am trying to figure out the best way to read in a large amount of data from a text file and then sort it using two keys. I have found many examples of sorting multidimensional arrays using a single key but not two keys. I have seen suggestions for using lists, tuples and datasets but still nothing on how to sort with two keys.
The text file I read in will typically have about 80 to 90 header records and then anywhere from 2000 to over 1000000 lines of data. I need to get four data items from each line.
Line# is in columns 2-5 and is an integer
Station# is in columns 22-25 and is an integer
Xcoord is in columns 47-55 and is a double
Ycoord is in columns 56-65 and is a double
Once the data is loaded I need to sort by Line# as the first key and Station# as the second key.
So which is the best way to do this? Multidimension array? Lists? Tuples? Datasets? Datatable?
I did try to do it using a datagridview but it was taking way to long to load the data from a file with 650000 records.
Thanks in advance for any help that I can get.