I have a script that generates a .txt file.
That file have tab-delimited columns.
The number of columns vary depending on the input file.
How can I convert that .txt file to csv format? I want to have the columns in the .txt file be in separate columns in the csv file.
sample:
.txt file:
header1 header2 header3 header4
1 B 423.sagd.32 333
2 A YXTS.a324.gfd33 555
3 F 343.asr 222
4 D cbs.98st.asd 4232
CSV file (expected output):
A B C D
1 header1 header2 header3 header4
2 1 B 423.sagd.32 333
3 2 A YXTS.a324.gfd33 555
4 3 F 343.asr 222
5 4 D cbs.98st.asd 4232
Note: The file do not have a fixed number of columns or rows.