https://bz.apache.org/ooo/show_bug.cgi?id=125636

--- Comment #7 from Lars Jødal <[email protected]> ---
Agreed, CSV is not a spreadsheet format and formatting cannot be saved in a CSV
file. CSV is a simple-but-not-too-well-defined data format. And any application
(such as Calc) interpreting the contents as more than simply a text file, must
make assumptions about the interpretation.

When I open a CSV file, I am given the chance to state some of these
assumptions:
- is the delimitor character the standard comma (,) or another character?
- which character set should be assumed?
- which language settings should be assumed?

My choices in the loading process influences how the contents of the file is
interpreted by Calc. Most specifically, the language setting will influence how
decimal numbers and dates are read. For instance:
- Is 1,23 a valid number? With language setting Danish it is, with language
settings English it is not.
- Does 01-03-2015 means January 3rd or March 1st?

(I expect we all agree this far)

Now, what I have suggested is for Calc to format the cells with the chosen
language setting WITHIN CALC. If the user saves in CSV format, the format is
not saved, but the FORMATTING used in writing the data does depend on the
language settings of the cells. Calc's internal representation of the number
1.23 should not concern me as a user, but it does concern me if it is written
as 1.23 or 1,23 when I choose to write the data as a CSV file. I can make this
choice by formatting the cell in Calc with a suitable language settign.

As it is, I can choose "English" when loading the CSV file into Calc. But my
choice of "English" is forgotten after the loading, so if I save the file then
my standard language format is assumed. I am suggesting Calc to remember my
choice by formatting the cells with the language from loading. In that way,
data will be written with the assumptions from the language chosen at loading,
enhancing the probability that the format is correct. Put another way:
Enhancing the probability that opening a CSV file and then writing the same
data to a CSV file will produce identical files.

Yes, writing in CSV format is risky unless you know what you are doing (and
even then). But I am not aware of any cases where the suggested enhancement
could make it LESS likely that the files were identical. If the user does not
make any choice of language when loading the file, then it will be loaded with
the user's standard language, and the cells will be formatted with that
language.

PS: Thanks for the links on reading CSV files.

--Lars J

-- 
You are receiving this mail because:
You are the assignee for the issue.

Reply via email to