Save as CSV stricter rule following

I am exporting a sheet of several thousand rows from LibreOffice and importing this data into something else. What I am importing this into requires very specific formatting, and I cannot seem to get the filters to save it in the format that it seems it should.

It is really just the typical csv format, except that the rules must be strictly followed. LibreOffice, with every setting I have changed, still exports numbers and empty cells without quotes.

Process I am currently using (though I have tried different versions of this:
File > Save As > check “Edit filter settings” and select csv for format > Character set: [Unicode (UTF-8)], Field delimiter: [,], Text delimiter: ["], checked “Save cell content as shown” and “Quote text cells”.

This will export:

[name][][][6][blah]

as

“name”,6,“blah”

when I am wanting

“name”,"","",“6”,“blah”

That would nearly work. The problem that would leave is numbers, which also do not get quotes.

My best workaround I came up with was to save without quotations and do a find and replace , with “,”. That left me manually entering the first and last ", but that was still better than doing it all.

I know this is old but as I was looking for the same information I thought I would post what I found.

Select all fields and set the format to text then save as Text CSV and check edit filter settings and set the field delimiter to , and the text delimiter to " and all fields are quoted.

Here’s a work-around.
Do a search and replace on your table. Leave the search-for box blank, replace with ### (or some other unique string) and check the Entire-cells box.
Export the CSV using the quote-all-text-cells option. The formerly empty cells will be quoted “###”.
Process the CSV file to replace ### with [nothing]. On Linux you could use sed

sed 's/###//g' input.csv >output.csv

but any text editor could work.

If you’re okay with post-processing, run the export with a unique character delimiter that doesn’t appear in your document (e.g. \t) and turn off all field-level quoting.

Post-process with something like:

perl -ne 'chomp; @fields = split /\t/; print join ", ", map { qq/"$_"/ } @fields; print "\n"' lo-export-file-here.csv > output-file.csv