Parse Large File - Python Tools
zopestoller at thomas-guettler.de
Mon Aug 19 14:42:39 CEST 2002
> Hi All,
> I want to parse a large text file( size = 30MB ). Is there any already
> available python tools ?
> Say, I want to match the following pattern:-
> Line "This is first line" followed by line "This is second line"
> followed by "This is fifth line".
> Result should be match SUCCESS ONLY for File1.txt as input and NOT for
Something like this?:
if not line:
elif one and line=="two":
print "'one' followed by 'two'"
You could write your line in a list (["one"], ["two"], ...) and
use a list for storing the varibles (one, two), too.
More information about the Python-list