Bug 100598 - FILEOPEN FILESAVE csv
Summary: FILEOPEN FILESAVE csv
Status: RESOLVED DUPLICATE of bug 51071
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.8.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-25 05:07 UTC by aa169d62f81
Modified: 2016-07-20 23:35 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aa169d62f81 2016-06-25 05:07:05 UTC
Abstract:
LibreOffice saved a spreadsheet as a csv file without warning.  Only one sheet (the least important) was saved.  All formulae were, as expected with csv format, converted to textual representations of the (calculated) result.

This behavor semms different from what I remember.  I would have expected warning messages (pop-ups).

Synopsis:
1) I typed (at the BASH command prompt) 
   soffice surv-table.csv
2) I made numerous style changes and formulae on multiple sheets over several hours.
3) I tried to close the file (X in the right side of the title bar), Calc asked me if I wanted to save my changes, etc.
4) OF COURSE, I said I wanted to save my changes.
5) When I tried to open surv-table.ods, I found it did not exist.
6) Further investigation found that the first sheet (the one with the fewest formulae) had been saved in surv-table.csv

Details:
OS: Linux Mint 17 Qiana
LO Version:  4.2.8.2
Did not try with any other operating system or version.

1) I found some data on the web.  I copied and pasted it to an editor, modified it, and save it with a csv extension.  Note: Normally I would not save it with that extension, but LibreOffice will otherwise try to use Writer. An annoyance that I can live with.  (Normally I would use no extension.)
2) I opened the file with ``soffice surv-table.csv''.  (I usually use the command line as it is more efficient. If I open calc and then use insert, LO will use some bizarre directory and not the current directory.)
3) I made many edits, using styles, but more importantly complicated formulae.
   Multiple sheets were used.  Other programs were used to make sure the formulae were correct.
4) I actually thought I had saved my work, but when I clicked X in the title bar, I was asked if I wanted to save my changes, ...
5) OF COURSE, I wanted to save my work!!!!!
6) I said YES, but LO Calc saved only the first sheet.  

I am sure that at some point in the past I tried to save a Calc file that I thought was a spreadsheet and I was warned with something to the effect that ``Some features of LO Calc will be lost if saved in this format.'' Further, I am pretty sure that whenever trying to save a spreadsheet with multiple sheets in csv format, there is a warning pop-up to the effect that only the current sheet will be saved.  What is going on?

Please do not save spreadsheets as csv files without warning.  (A spreadsheet has styles, formatting, and/or formulae.)

Suggestion: If one types ``soffice foo.csv'', IMMEDIATELY change the internal, not the file system name, to ``foo.ods''.  After all, it appears as if one is modifying an ods file.
Comment 1 Aron Budea 2016-06-25 06:22:51 UTC
I tested this, and you are correct, there are supposed to be two warning mechanisms. However only one of them is applicable here, because the one warning about saving multi-sheet documents in CSV format only comes up if you save in a new CSV. In this case, since you're already in CSV format, it's not shown.

The one that should come up is the warning about different file formats. Note that this warning can be disabled, which could be the case for you. Is this checkbox checked?
Tools -> Options... -> Load/Save -> General -> Warn when not saving in ODF or default format

I can relate to how frustrating losing your work can be over such a trivial mistake. Personally, I think the multi-sheet warning could be extended to be always shown with multiple sheets, or shown if you try to save after adding a new sheet. Note however that the issue is more general: if you open a CSV and add some other feature to the sheet, like a chart, you still wouldn't get a warning, unless you had the other warning enabled (the one on saving to non-ODF formats). 

So extending the multi-sheet warning could only help avoiding one specific kind of mistake, plus one could argue once the user opens a file, they should already be aware of the format they're dealing with.
Comment 2 Buovjaga 2016-06-29 08:35:44 UTC
Asked for guidance on #libreoffice-dev and conclusion is that this can be closed as NOTABUG as it works as designed.
A more robust solution would be to allow CSV export only and NOT save, but that would be a controversial change like GIMP's jpeg export.
Comment 3 Aron Budea 2016-07-20 23:35:09 UTC
Actually, bug 51071 is more or less the same issue/enhancement request.

*** This bug has been marked as a duplicate of bug 51071 ***