Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a=[]
- b=[]
- c=[]
- d=[]
- e=[]
- with open('dump.sql', 'r') as dump:
- for line in dump:
- if string1 in line:
- tail1 = line.split(string1)[1]
- for group1 in tail1.split("),("):
- group1 = group1.replace("'", "").replace("(", "").replace(")n", "")
- a.append(group1.split(",")[3].strip())
- b.append(group1.split(",")[9].strip())
- c.append(group1.split(",")[2].strip())
- if string2 in line:
- tail2 = line.split(string2)[1]
- for group2 in tail2.split("),("):
- group2 = group2.replace("'", "").replace("(","").replace(")n","")
- d.append(group2.split(",")[2].strip())
- e.append(group2.split(",")[3].strip())
- if(set(a)&set(e)):
- x.append(group2.split(",")[4].strip())
- a=[1, 2, 3, 4, 5, 6]
- c=[7, 8, 9, 10, 11, 12]
- d=[11, 9, 7, 10, x, k]
- e=[1, 3, 5, 6, p, w]
- 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.
- 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