Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 92007
- 92011
- 92014
- 92024
- 1;
- 92058
- 92067
- 92075
- 92083
- 2;
- nums = open('numbers.txt','r')
- full = {}
- arr = []
- while 1:
- read = nums.readline()
- if len(read) > 0:
- if len(read) == 6:
- read = read[0:5]
- arr.append(read)
- elif len(read) < 6:
- read = read[0]
- full[read] = arr
- arr = []
- else:
- break
- csv = open('numbers.csv','w')
- for i in full:
- for j in full[i]:
- line = str(j) + ',' + str(i) + 'n'
- csv.write(line)
- csv.close()
- read = read[0]
- read = read[0:len(read)-2]
Add Comment
Please, Sign In to add comment