14

I just opened a CSV file in LibreOffice, made a small change and hit save, saying "yes, keep using CSV". The file is now filled with tabs instead of commas. My scripts (using Python's CSV lib) won't read it and I have go out of my way to replace tabs with commas.

Just to be clear: a CSV file by very definition uses commas, otherwise it'd be a TSV file, right?

Is there some option in LibreOffice I can set to make it use commas when writing CSV files?

3 Answers 3

16

For some users (thoses using KDE), the "edit filter settings" box is gray. A workaround is to use Openoffice dialogs. Tools > Options > LibreOffice > General > Open/Save dialogs > Use LibreOffice dialogsenter image description here Then you will be able to choose the field delimiter wanted.enter image description here That bug was reported here : https://bugs.freedesktop.org/show_bug.cgi?id=72187

1
  • 7 years later, on Ubuntu 20.04 (on Gnome) I was hit by this issue. Thanks for your reply!
    – mTorres
    Apr 9, 2021 at 7:33
16

When you export a CSV file, go to File > Save As, select Text CSV as file type and then go to Edit filter settings.

In this dialog you can select the cell delimiter and change it from Tab to a comma.

4
  • Under "file->export", there's only xhtml and pdf. In "file->save as" there's csv but the checkbox for "Edit filter settings" is greyed out and no further related dialogue boxes show.
    – jozxyqk
    Feb 15, 2014 at 12:44
  • There should be "Text CSV" as depicted here: csvimproved.com/images/tutorials/libreoffice_saveas.png — it's also explained on the LibreOffice wiki: help.libreoffice.org/Calc/Importing_and_Exporting_CSV_Files
    – slhck
    Feb 15, 2014 at 12:51
  • I have that window, unfortunately my "Edit filter settings" is disabled just like your "Save with password". I can only guess there's some conflicting option somewhere. I'll keep trying, but thanks for your time!!
    – jozxyqk
    Feb 15, 2014 at 13:05
  • You don't export to csv, you save as csv
    – jojman
    Jan 17, 2019 at 13:18
0

The problem is probably that when you opened (i.e. imported) the CSV file, you had both Tab and Comma enabled as separators:

import dialog

With that, LibreOffice will unfortunately use tabs as separators when writing/exporting (even if the original file contained only commas, not tabs). If you uncheck Tab at import time, it will preserve the commas on export.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .