[Tutor] ideas on how to process a file

Spencer Parker inthefridge at gmail.com
Fri Apr 10 17:01:33 CEST 2009


I have a flat file database that I want to get information from.  The basic
text looks like this:

ITEM    {
        "FULLNAME"      "apps114.chgit.com!file:/etc"
        "RECOVERY"      "0"
}

They are all on a separate line in the text file.  I had thought about
trying to drop it into a list or a dictionary.  Most likely a dictionary.
What would be the best practice to get this into a dictionary?  I had
thought about using regular expressions to pull the data I need.  Just not
totally sure how to approach this for the most part.  Not looking for
solutions just ideas on how to approach the problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090410/f047f940/attachment.htm>


More information about the Tutor mailing list