I'm a beginner in python coding I wrote a little script to convert text files in a folder to csv files. The script is running but it delivers a csv file with only one column. Where's my fault? Also the converted files contain always .txt.csv. I would appreciate some help. Thanks a lot!
Thats the format of the txt. file
Thats my code
import os
import pandas as pd
input = "C:\\path where original data is"
output = "C:\\path for csv files"
os.chdir(input)
txt_files = os.listdir('.')
print(txt_files)
for txt_file in (txt_files):
df = pd.read_csv(txt_file, delimiter = ',', names=['Messpunkt\t','Zeichnungspunkt \t','Eigenschaft\t','Position\t', 'Sollmaß\t','Toleranz\t','Abweichung\t','Lage\t' ])
df.to_csv(output+txt_file+'.csv', index=False)