Guest User

Untitled

a guest
Dec 13th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. a=[]
  2. b=[]
  3. c=[]
  4. d=[]
  5. e=[]
  6.  
  7. with open('dump.sql', 'r') as dump:
  8. for line in dump:
  9. if string1 in line:
  10. tail1 = line.split(string1)[1]
  11. for group1 in tail1.split("),("):
  12. group1 = group1.replace("'", "").replace("(", "").replace(")n", "")
  13. a.append(group1.split(",")[3].strip())
  14. b.append(group1.split(",")[9].strip())
  15. c.append(group1.split(",")[2].strip())
  16. if string2 in line:
  17. tail2 = line.split(string2)[1]
  18. for group2 in tail2.split("),("):
  19. group2 = group2.replace("'", "").replace("(","").replace(")n","")
  20. d.append(group2.split(",")[2].strip())
  21. e.append(group2.split(",")[3].strip())
  22. if(set(a)&set(e)):
  23. x.append(group2.split(",")[4].strip())
  24.  
  25. a=[1, 2, 3, 4, 5, 6]
  26. c=[7, 8, 9, 10, 11, 12]
  27.  
  28. d=[11, 9, 7, 10, x, k]
  29. e=[1, 3, 5, 6, p, w]
  30.  
  31. e[2] has the same element as a[3] => check d[2] has the same element as c[3] => correct => x[3] will have a the new element extracted from that string.
  32. e[3] has the same element as a[5] => check d[3] has the same element as c[5] => incorrect => nothing should be done with x[3]
Add Comment
Please, Sign In to add comment