ignore specific data
pkilambi at gmail.com
pkilambi at gmail.com
Mon Nov 21 13:08:24 EST 2005
Hi I need help. What I want to do is If I read a file with some text
content...
I would like to ignore a block of lines and consider the rest..
so if the block starts with
"start of block............."
fjesdgsdhfgdlgjklfjdgkd
jhcsdfskdlgjkljgkfdjkgj
"end of block"
I want to ignore this while processing the file .This block could
appear anywhere in the file.It could at the start or end or even middle
of file content.
Hope I'm clear...
somethin like
f = open("file")
clean_data = ignore_block(f)
here ignore_data should filter the block
def ignore_data(f):
.............................
return data # may be an array of remaining lines...
More information about the Python-list
mailing list