Nov-14-2020, 05:06 AM
I really appreciate your help!
I see your point but your code does not have an "else" statement.
I need it, I need to process lines that do not match.
I can print lines that are matched. The iteration in Python is a horror story.
I'd like to repeat, I do not have(by now) finding or matching lines, I have a problem printing those that do not match.
Here is a try 234 of the script:
I see your point but your code does not have an "else" statement.
I need it, I need to process lines that do not match.
I can print lines that are matched. The iteration in Python is a horror story.
I'd like to repeat, I do not have(by now) finding or matching lines, I have a problem printing those that do not match.
Here is a try 234 of the script:
fout = open ('C:/Scripts/sometext.txt','w') with open ('C:/Scripts/Python/CurMACs.txt','r') as cur_fl : cur2 = cur_fl.readlines() with open ('C:/Scripts/Python/Matched_MACs.txt','r') as m_file : for m_line in m_file : m_line = m_line.rstrip() sp_m_line = m_line.split(",") m_ltof = sp_m_line[0]+","+sp_m_line[1] for cln2 in cur2 : cln2=cln2.rstrip() # print ("Current Line file -->> ",cln2) if m_ltof in cln2 : #print ('Found Matched line -- ',cln2) new_n = cln2+","+"Online" print (new_n) fout.write(new_n+'\n') break # else : # print ("OFFLINE !!!!!",cln2) # #new_off= cln2+","+"OffLine" # #fout.write(new_off+'\n') # break fout.close()I tried to move the 'else' block all over the place wrote a countless number of snippets and still cannot print the lines that do not match..