southbeach
Programmer
I have the following problem.-
flat file looks like this:
0 1 2 3 4 5 6 7 8 <- not in file, just for this illustration
A~B~C~D~0~A~2~B~X
I can easily use file() to read file into an array and use sort()to sort the array.
Here is the kicker, sort() will work based on column 0 and I need to be able to sort on any of the columns.
Here is my idea:
1. Load file to array1
2. Place sort column as column 0 shifting the array 1 column
3. Sort the newly altered array
I am afraid of the time this process may take and was hoping one you guys/gals would have a better idea.
Thank you all in advance for your time!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
flat file looks like this:
0 1 2 3 4 5 6 7 8 <- not in file, just for this illustration
A~B~C~D~0~A~2~B~X
I can easily use file() to read file into an array and use sort()to sort the array.
Here is the kicker, sort() will work based on column 0 and I need to be able to sort on any of the columns.
Here is my idea:
1. Load file to array1
2. Place sort column as column 0 shifting the array 1 column
3. Sort the newly altered array
I am afraid of the time this process may take and was hoping one you guys/gals would have a better idea.
Thank you all in advance for your time!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.