My Big Dict.

Xavier sabu at pure-elite.org
Wed Jul 2 00:13:26 EDT 2003


Greetings,

(do excuse the possibly comical subject text)

I need advice on how I can convert a text db into a dict.  Here is an
example of what I need done.

some example data lines in the text db goes as follows:

CODE1!DATA1 DATA2, DATA3
CODE2!DATA1, DATA2 DATA3

As you can see, the lines are dynamic and the data are not alike, they
change in permission values (but that's obvious in any similar situation)

Any idea on how I can convert 20,000+ lines of the above into the following
protocol for use in my code?:

TXTDB = {'CODE1': 'DATA1 DATA2, DATA3', 'CODE2': 'DATA1, DATA2 DATA3'}

I was thinking of using AWK or something to the similar liking but I just
wanted to check up with the list for any faster/sufficient hacks in python
to do such a task.

Thanks.

-- Xavier.

oderint dum mutuant







More information about the Python-list mailing list