I am trying to converting excel file to csv file. the data in the excel file is like below:
My code to convert to csv:
import pandas as pd
import glob
for excel_file in glob.glob('C:/Talend/DEV/MARKET_OPTIMISATION/IMS/*Extract*.xls'):
print(excel_file)
data_xls = pd.read_excel(excel_file, 'Untitled', index=0,skiprows=1, sep='|',encoding='utf-8')
#data_xlx.pop
data_xls1=data_xls.replace('\r\n','')
data_xls1.to_csv('C:/Talend/DEV/MARKET_OPTIMISATION/IMS/IMS_Raw_data.csv',sep='|',encoding='utf-8')
The output of the above code is:
can anyone please help me in removing the line breaks on the excel file.
Thank you in advance.


