After implementing some of the solutions in my previous question, I've come up with the following solution:
reader = open('C://text.txt')
writer = open('C://nona.txt', 'w')
counter = 1
names, nums = [], []
row = reader.read().split(' ')
x = len(row)/2
for (a, b) in [(c, d) for c, d in zip(row[:x], row[x:]) if d!='na']:
print counter
counter +=1
names.append(a)
nums.append(b)
writer.write(' '.join(names))
writer.write(' ')
writer.write(' '.join(nums))
This program works quite well for a smaller sample data set. However it freezes up when I use the full data set and causes python to crash. Any suggestions on how I can overcome this?