Hi
Rather than store the arrays sorted, my first thought would be to store them as they arrive but construct the csv record from the array values in ascending order at the time you write your record to SD.
I don't have a sketch as an example so please post your existing sketch here so we can give you some pointers on what you can do in your specific case. (remember to use the # button to enclose your sketch in CODE tags)
Does your sketch do what you outlined in the first post currently (ie multiple entries)? That will be a solid place to start.
Cheers! Geoff