Advertisement
Guest User

checkFile

a guest
May 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. in1 = raw_input("file 1 path:") #if using python 3, raw_input is input
  2. in2 = raw_input("file 2 path:")
  3. file1 = open(in1,'r')
  4. file2 = open(in2,'r')
  5. match = false
  6. file3 = open("3.txt",'w')
  7. for line1 in file1:
  8. for line2 in file2:
  9. if line1 != " " and line2!= " " and line1==line2:
  10. match = true
  11. file3.write(line1)
  12. file3.write("\n")
  13. if line1 == " " or line2 == " " and match == true:
  14. file3.write("\n")
  15. match = false
  16. if line1!=line2:
  17. match = false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement