File Handling Problem
subhakolkata1234 at gmail.com
Fri Sep 4 14:50:11 CEST 2009
I have a file. The file has multiple lines. I want to get the line
number of any one of the strings.
Once I get that I like to increment the line number and see the string
of the immediate next line or any following line as output. The
problem as I see is nicely handled in list,
but can it be for string and file?
I can generally put a cursor and move it back and forth for my need
using index/find and then re. But, I was looking to use some built-in
methods. Can I use fileinput or ast? But, I was not finding any good
resources, using http://docs.python.org/library/fileinput.html#fileinput.input,
etc. did not help much.
If any one can kindly help me out.
More information about the Python-list