forked from jcodagnone/localidades-ar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1.py
executable file
·37 lines (33 loc) · 884 Bytes
/
1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
rf = file('dbpedia/dbpedia.csv', 'r')
lf = file('codigo-postal/correo.csv', 'r')
def r():
a = rf.readline().replace('\n', '').strip().replace('"', '').split('\t')
print len(a)
if len(a) < 6:
a.insert(0, '')
else:
a[0] = int(a[0])
a[1] = a[1].strip()
return a
def l():
a = lf.readline().replace('\n', '').strip().split('\t')
a[0] = int(a[0])
return a
d = r()
i = l()
while True:
if d[0] == i[0]:
if d[1] == i[len(i)-1]:
print d,i
d = r()
i = l()
else:
#print d
d = r()
elif d[0] < i[0]:
#print d
d = r()
else:
#print i
i = l()