'I am trying to read csv file and convert it into Excel files without libraries is that possiible(Xlsx writer,openpyxl)

My current code :

for file in glob.glob("*.csv):
 df=pd.read_csv(file)
 df.to_excel("file.xlsx",sheet_name=file,index=false)

path="C:/Master/"
writer=ExcelWriter(Path+"output.xlsx")
for filename in glob.glob("*.xlsx")
 exc_f=pd.read_excel(filename,engine='openpyxl')
 (_,f_name)=os.path.split(filname)
 (f_shortname,_)=os.path.splittext(f_name)
 for sheet_name in exc_f:
   df_excel=pd.read_excel(filename)
   df.excel.to_excel(writer,f_short_name,index=False)
writer.save()

I am trying to read csv files in folder and convert that into seperate xlsx sheet(if 3 csv files then 3 xlsx sheet should present in folder).after converting,i am combining into sinsle work book with 3 sheets.Is that possible without usiing any librariies.Anyother alternative approach we can use(Output : single workbook with 3 differnt sheets)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source