Hi Experts,
I am new to Python. The query is to Compare the 4th filed of two text files if the difference is greater than or less than 15%, then we need to print the filenames.
The two text files are attached and the code i tried is also attached.
arr1 = []arr2 = []for line1 in open("testReport_flame3_0202.txt"): linesa= line1.strip().split(",") arr1.append(linesa[4])for line2 in open("testReport_flame3_0209.txt"): linesb= line2.strip().split(",") #print linesb[4] arr2.append(linesb[4])lenth = len(open("testReport_flame3_0202.txt").readlines())for i in range(1,lenth): if((((arr1[i] - arr2[i])/arr1[i])*100) > 15): # failing at this step print i# after this i am not getting how to fetch the respective filename