with open(txt_file) as infile:
    with open(csv_file, 'w') as outfile:
        writer = csv.writer(outfile)
writer.writerows(row.split() for row in infile)
converting file from .txt to .csv doesn't write last column of data