Combine csv files into one multi-sheet xlsx using headless

Does anyone know of an ‘soffice --headless’ command to merge multiple .csv files into a single .xlsx spreadsheet where each .csv file become its own sheet within the one spreadsheet? So for example, if I have 5 csv files, I want to merge them into a single .xlsx file that contains 5 separate sheets.


The command below will convert each csv to xlsx. But will not merge into one xlsx sheet. I’m still trying to figure that out as well. Let me know if you figure it out.

soffice --headless --convert-to xlsx:“Calc MS Excel 2007 XML” --infilter=“csv:44,34,UTF8” *.csv

Is headless an absolute restriction? What about macro code?