fileinput.input, readlines and ...
mail131 at gmail.com
Wed Jun 24 06:23:30 EDT 2009
I many files with log data. The structure of the file is quite
inconvenience and similar to the following example:
To get the values I need to find Data* and then get to the next line.
I tried to use fileinput.input :
for line in fileinput.input(filename):
if line.find("Data2") >= 0:
(now what ?)
So I can find the requested line (Data2) but how to get value from the
next line ?
Is the fileinput.input the most convenient for this type of task ?
readline or readlines would be better ?
What can you recommend ?
More information about the Python-list