Hi folks,
i have a bunch of tab delimited .csv's - which is nice.
But now my coworker is telling me, he needs all theese .csv's as .txt since his special Software only accepts .txt.
I hope this can't be too dificult, since both formats are textfiles...?
The resulting files have to be "tab delimited"...
How should i approach this task?
here is the code i've gotten my .csv files from (thanks to the folks here that helped me):
i have a bunch of tab delimited .csv's - which is nice.
But now my coworker is telling me, he needs all theese .csv's as .txt since his special Software only accepts .txt.
I hope this can't be too dificult, since both formats are textfiles...?
The resulting files have to be "tab delimited"...
How should i approach this task?
here is the code i've gotten my .csv files from (thanks to the folks here that helped me):
import pandas as pd df = pd.read_csv('/home/Cutting Excel/Kastanie_Jahrringe.csv', sep=';') for col in df.columns[1:]: if col.endswith('.1'): fname = '/home/Cutting Excel/Cut Pieces/{}.csv'.format(col.replace('.1', 'b')) else: fname = '/home/Cutting Excel/Cut Pieces/{}a.csv'.format(col) df.to_csv(fname, sep='\t', columns=['YEAR', col], index=False, na_rep='NA', header=['YEAR', col.replace('.1', '')])