I have a file with name ids.txt also file with name names.txt
in the ids.txt file we see:
23
422
5123
642
8743
the content of the names.txt file:
jon1
jon2
jon3
jon4
jon5
I want to sort it like this:
23 jon1
422 jon2
5123 jon3
642 jon4
8743 jon5;
and when it's sorted the last one set it like this
8743 jon5;
what I'm doing is :
IDs = file("IDs.txt").read().splitlines()
names = file("names-specialitys.txt").read().splitlines()
for i in IDs:
for n in names:
print i, n
but it's print it like this:
23 jon1
422 jon1
5123 jon1
642 jon1
8743 jon1
23 jon2
... etc
zipthe two lists.