sorting strings written to files

onefatman member27857 at dbforums.com
Wed Apr 9 02:47:08 EDT 2003


Can someone help me?

I have a small phone directory .dat file that has the entries
written to it as strings with three fields in each, separated by \t
and ended by \n.

e.g.
phbook.write("Joe\tNobody\t62907243\n")
phbook.write("Daniel\tStevens\t62962328\n")
phbook.write("Ellen\tWay\t62910758\n")
phbook.write("Jason\tGreig\t62314587\n")

it has a function that allows you to write new entries, but i need to
know how to sort them by first name, and then by last name when the
first names are the same.

please help.
Daniel

>>>>>>>>>>>>>>>>>>>>
Also, does anyone know how to delete details and change details? it
would be a big help. thanks.

--
Posted via http://dbforums.com




More information about the Python-list mailing list