I want to start parsing a text file at the first empty line of a text file .The first few lines of each text file have URL’s that I don’t want in my search and each file has a slightly different length header. Each file has a empty line between the header and the body of text, so I would like to start my regex search after the empty line
I know how to find the empty lines but can’t figure out how to get their index.
myfile = open(mydir,'r')
for line in myfile:
if line in ['\n', '\r\n']:
print 'Found it'
Any help appreciated
Just step through the file ignoring everything until you find the empty line. Then process the rest.