Answer the question
In order to leave comments, you need to log in
How to convert file from *.csv to *.xlsx in Golang?
db, err := sql.Open("postgres", fmt.Sprintf("user=%s dbname=%s host=%s sslmode=disable",
DB_USER, DB_NAME, "/var/run/postgresql"))
defer db.Close()
checkErr(err)
db.Query("Copy (Select * From export) To '/var/www/html/exportGo/export/testt.csv' With CSV DELIMITER ',';")
Answer the question
In order to leave comments, you need to log in
You need to go to github and search for xlsx. There are a lot of ready-made golang libraries for working with xlsx.
For example https://github.com/tealeg/xlsx
Or even https://github.com/tealeg/csv2xlsx A simple program to convert CSV files into XLSX files.
In general, xlsx is just a format - in fact, xml is packed in zip - you can do everything from scratch.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question