I need to convert a text file to CSV. Please see my code below. My text file contains 5 columns separated by unequal spaces. When I converted this to a CSV file, all these 5 columns are coming in a single column in the Excel file.
Code:
import pandas as pd
dataframe1 = pd.read_csv("C:\HARI_BKUP\PYTHON_SELF_Learning\Funct_Noise_Corners_2p0_A.txt",)
dataframe1.to_csv('FF.csv', index = None)
I need a CSV file with each separate column. May I know where I went wrong?
TEXT FILE
Output after running the code
dataframe1 = pd.read_csv("C:\HARI_BKUP\PYTHON _SELF Learning\Funct_Noise_Corners_2p0_A.txt", sep="\t")