Extracting values from text file
randhol at bacchus.pvv.ntnu.no
Fri Jun 16 04:36:32 EDT 2006
A short newbie question. I would like to extract some values from a
given text file directly into python variables. Can this be done simply
by either standard library or other libraries? Some pointers where to
get started would be much appreciated.
An example text file:
Some text that can span some lines.
Some more text.
0.5 g butter
What I first though was if there was possible to make a filter such as:
(butter) g butter
The data can be put in a hash table.
Or maybe there are better ways? I generally want something that is
flexible so one can easily make a filter settings if the text file
Thanks in advance
More information about the Python-list