[Tutor] Best approach to sort data based on several criteria

Quentin qsc@icon.co.za
Mon Jul 21 11:21:56 2003


OK, I am not going to give you a Python answer, but some ways to 
consider, I've done similar things the past few months (I used VB, and 
hope to do it with Python in the future):
Main thing I would do is to convert the file into a data base. This will 
give you so much more control over reading and editing the data. And so 
much easier to program an app to read and sort a database than a large 
text file. I use MySQL database (another opensource project, and it is 
also supported by Python).
You can use MySQL admin to create a data base and then write a small 
Python app to read your file data in. ( you can even use Python to 
create a database direct).
<or>
If you are not to up too speed with Python (like me) you can:
Use a spreadsheet program to open the (txt, I presume, or CSV) file and 
set it to parse your data into spreadsheet columns based on the 
deliminator (You said ";"), then, either:
1. Export it direct to a database.
2. Save it as a text file that MySQL will understand and use to import data.
Read the MySQL tutorial that is in the docs, and you will understand a 
lot of what I've said.
http://www.mysql.com/

Quentin