0

I encountered some trouble changing cell types in LibreOffice Calc from text to dates.

This happens when I import a CSV file. The import into rows and columns works fine. However, the dates are not recognized as such. When I try to change the cell type manually via "Format Cells..." to the appropriate date format Calc only prepends a ' to the cell.

Example: The text "19.03.24" reads "'19.03.24" after manually changing the cell format to date.

I suppose there is some "hidden" setting that prevents me from changing the cell type.

2 Answers 2

0

Okay, I found a solution here.

However, any comment on how that magic worked or why date formatting fails will still be appreciated.

2
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Mar 19 at 20:08
  • Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.
    – DavidPostill
    Commented Mar 19 at 21:30
0

CSV, comma separated values, though other separator characters, such as tab, are also used, has no concept of specific format, not as date, currency, Boolean or other data type.

All data in a CSV is treated as numeric, unless the data field contains specific characters, e.g., begins with a single quote, ', or is surrounded by double quotes, ".

Look at the CSV data in a text editor. If there are quotes at the beginning of a field, MS Excel, LibreOffice Calc and other spreadsheets treat that as text.

To remove initial single quotes, use the text editor to search and replace them. If there are internal quotes to be preserved,

  • Search on the separator and quote, e.g., ,', and replace with just the separator, e.g., ,.
  • For the initial field of a line, search on the end-of-line sequence and quote, e.g., \r\n', using regex, and replace with just the separator, e.g., ,.

You must log in to answer this question.

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