Writing data from Julia to an Excel Spreadsheet

I think that the easiest way to go about this is to focus on creating a DataFrame first. If the DataFrame looks good, you can transform it into a CSV or Excel sheet.

To go to an Excel sheet, you can use this code:

using DataFrames
import XLSX

path = "/path/to/file"
XLSX.writetable(path, collect(eachcol(df)), names(df))

I’ve been running writetable in production for months already and had no issues with it so far.
In general, I do find the CSV.jl interface easier to work with though.

2 Likes