Aug-31-2020, 04:06 AM
Sure.
I'm trying to pull out two lines after a matched line, I'm splitting both lines and will extract elements from each line and print it it to a different file.
I have no errors after the first:
ln_f = next (each_dirf)
but after the second:
ln_f = next (each_dirf)
errors starts.
Here is a bloc I have the problem with.
I have next two bloks like this one and both producing the same error. rest of the "IF" blocks having NO problems.
I'm trying to pull out two lines after a matched line, I'm splitting both lines and will extract elements from each line and print it it to a different file.
I have no errors after the first:
ln_f = next (each_dirf)
but after the second:
ln_f = next (each_dirf)
errors starts.
Here is a bloc I have the problem with.
I have next two bloks like this one and both producing the same error. rest of the "IF" blocks having NO problems.
if 'type="HDDD' in ln_f : ln_f = next (each_dirf) ln_f = ln_f.lstrip() ln_f = ln_f.replace("=", " ").replace('"','') mm11 = ln_f.split(" ") w1 = slot_number+","+mm11[8]+","+mm11[10]+","+mm11[12]+","+mm11[14]+","+mm11[18]+" "+mm11[19] XML_Lines_Out.write(w+w1+'\n') ln_f = next (each_dirf) ln_f = ln_f.lstrip() print (">>>>> ", ln_f)