On 09/30/09 18:18, Richard F Smit wrote:
I'm importing and exporting a CSV file through Calc. The data is generated by a script, and the result must be readable by other bash scripts.

Every field is quoted in double quotes, and I'm using commas as the delimiter.

However, OO.o Calc mangles dates. The dates are written in ISO short format (YYYY-MM-DD), but Calc automagically converts these to dates. I then select the column and format it as "text", and I get fields like "38846" for "2006-05-09". I want these to remain in the human readable format they were written in.

Additionally, when exporting these fields, it strips out the quote marks. This makes it difficult for the other scripts to parse.

Is there a way to control Calc's automagic sensing-and-mangling of formats? How can I protect these dates (and other non-text values)?

In the CSV import dialog, you can select the type for each column. After choosing separators, select a column using its header, or all columns using the area left of the column headers, and choose the type from the "Column type" list box or the column header's context menu.

If you want to import the data as text (and not do anything date-specific with the values), use column type "Text".

Niklas

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to