I'm reading data from a file. Most of the data in the data file will be read in and written out to an output file without modification. However, in places the data is separated by a blank line, which precedes 5 other useless lines. Here is my code:
#Now loop over the entire file
while True:
testline = infile.readline()
if len(testline) ==0:
break # EOF
elseif testline == '\n':
for i in range(0,5)
testline = infile.readline()
else:
outfile.write(testline)
I get the following error that has me stumped:
File "convert.py", line 31
elseif testline == '\n':
^
SyntaxError: invalid syntax
Any thoughts? I can't figure out what is wrong with my elseif statement.
elseifin Python. You wantelif.