I have multiple .txt files in a directory and I want to merge them into one by importing in python. The catch here is that after the merge I want to convert it into one csv file on which the whole program is based.
So far I only had to input one .txt file and converted it into csv file by this code:
import io
bytes = open('XYZ.txt', 'rb').read()
df=pd.read_csv(io.StringIO(bytes.decode('utf-8')), sep='\t', parse_dates=['Time'] )
df.head()
Now I need to input multiple .txt files, merge them and then convert them into csv files. Any workaround?