[Solved] Converting a large ASCII to CSV file in python or java or something else on Linux or Win7


If you are absolutely certain that each entry is 92 lines long:

from itertools import izip
import csv

with open('data.txt') as inf, open('data.csv','wb') as outf:
    lines = (line[2:].rstrip() for line in inf)
    rows = (data[1:89] for data in izip(*([lines]*92)))
    csv.writer(outf).writerows(rows)

1

solved Converting a large ASCII to CSV file in python or java or something else on Linux or Win7