Help with inverted dictionary

rorley at gmail.com rorley at gmail.com
Tue Jul 12 11:25:50 EDT 2005


OK, so my problem is I have a text file with all of these instances,
for example 5000 facts about animals.  I need to go through the file
and put all of the facts (lines) that contain the word lion into a file
called lion.txt.  If I come across an animal or other word for which a
file does not yet exist I need to create a file for that word and put
all instances of that word into that file.  I realize that this should
probably create 30,000 files or so.  Any help would be REALLY
appreciated.  Thanks.  Reece




More information about the Python-list mailing list