
KevinR
Veteran

Aug 23, 2003, 1:53 PM
Post #2 of 10
(876 views)
|
|
Re: [andy7t] Sorting by a different Variable
[In reply to]
|
Can't Post
|
|
it looks you might be going about this in a convoluted way. If you can re-structure your data files this should be very easy. What you need are presorted files already on the server that you open depending on what the sort method is. The only time you need to sort is when a new entry is added. You put the new entry in all of the presorted files, then re-sort the files, then re-print them to disk already sorted by their respective sort criteria (age, name, whatever, whatever). You presorted name file might look like this: Andy,23,180 Bob,19,123 Fred,44,230 Joe,33,145 Your presorted age file might look like this: Bob,19,123 Andy,23,180 Joe,33,145 Fred,44,230 Now this situation is not always possible, but if it is it will make your life much easier and your scripts run faster since the sorting may only need to be done once in a while (when a new entry is added) instead of everytime the files are opened. -------------------------------------------------
|