OK, next question from this project that slowly is getting out of hand :sign0085:
I have a file that is built up like keyC=>key1, keyA=>key2, keyB=>key3 etc (PHP-style)
I cannot attach it as it is 280 kb in ZIP-format :sign0137:
It is sorted on the "number" keys. How can I sort it on the A,B,C keys, keep the relation with the "number" key, and write this back to the same file?
All help appreciated.......
Thnx Marc
just a silly question from me:
What prevents you from reading the file into a appropriate table... sort the table with your preferred keys... and write it back to the file.
Of course the last step must be done "manually" since Table.SaveCsv won't save in sort order.
as far as I can tell, it works the same as the table controls with a few teaks...
sMost of the props are the same....so it should be able to deal with any file lenght, limited only by the memory allocation...
As I understand the help file (looking at the "tablesort" in the main help):
Sorting can be done by more than column (in case of repeating values) using , (comma).
Example:
Table1.TableSort ("colFamilyName ASC, colFirstName ASC")
I personally like Specci48's approach best, but instead of writing back to the file manually, I would copy the sorted table across to another table and then use Table.SaveCsv to save the sorted data straight to file.