Default settings for opening csv files

What evidence? Considering what of locales?

Calc does all that as well. Additionally one can choose which locale the data is to be parsed in.

Widening the column according to the display width of resulting dates is indeed missing in some cases. IIRC there’s a bug about that.

My preference is data in databases using a spreadsheet as a fancy calculator to format the data. So data interchange is important.
.
The issues are the calc csv data parser could be better and it should not force the gui to be presented. A setting rather than a macro could better allow users to work as they want.
.
This topic has enough anecdotal evidence. A user can only have one locale at a time in a session.

Excel can treat numeric text as numbers. If some cell contains text “1,234” or “2/3/2022” Excel interpretes these wrong values according to its own locale settings. It does not matter that much if you did the import right or wrong. Drawback: You never know exactly if your data are interpreted correctly, if “1,234” is interpreted as a comma decimal when you send the file to a a co-worker or if “2/3/2022” is interpreted as a different date on the other side of the Atlantic.
Calc does it right. It does not interprete ambiguous numeric strings.
Calc always shows the import dialog. The dialog settings are saved. You just have to hit the Enter key to confirm the same settings as before.
Calc allows to specify an import locale that applies to the whole set of columns, so you don’t have to specify details for each and every column.

Personally, I rarely import any csv into sheets. For my daily csv from various bank accounts I use nothing but Base which works reliably and easily since many years.

Oh? What is “have”?
I can easily have several different CSVs that I need to open in one session, and those CSVs may come from totally different locales (even though the system locale of mine, as well as LibreOffice locale, hasn’t changed).

Oh? Where is a sample of a document, with a discussion how it loads incorrect (with an evidence that the locale settings were set correctly in LibreOffice)?

Too lame, anecdotal doesn’t count anything. Name it.

That is
a) wrong, one can even switch the default locale during one LibreOffice session
b) irrelevant, as the locale to import with can be selected for each import

1 Like

I understand they have very good snow ploughs in Europe. A snow plough might be good for you but I don’t want one in my locale (Australia) because there is no snow. Similar for most of the complexities of parsing data, people have different environments.

Was that a response to “name it”? Poor description.

Are there users expecting a csv importing service/routine to interpret textual dates correctly even if there is no information about the used format or if they are up-to-six-digits-slashed without stating the “running century”? Excel may try such dangerous nonsense. Calc shouldn’t join that gang. However, even Calc accepts #M/#D/#Y if Detect special numbers is enabled and (MDY) selected. In fact this should be denied if not an explicit statement is made inside the csv file. There are lots of reasons to judge such action “next to crime”. The only resonable and reliable behaviour of importing software is to import such monsters as text and to leave it to the user to make her(m/f) decisions accepting resposibility fhis way. The only date format reliably usable in data exchange (via csv or otherwise in texts) is ISO 8601 extended.
Other cases of ambiguity should be treated in a respective way. Spreadsheets and the software handling them are not intelligent and claiming intelligence where is none is dangerous in every case.

And this is part of the reasons NOT to mimick intelligence when importing csv. Users are tempted to make their personal environment an expectation concerning their data sources. Extremely dangerous - except you aren’t interested in reliable results anyway. And if you are definitely contented with the way Excel is working, you should use Excel. Then Excel and yourself at least can’t accuse Calc if they shot an airplane due to badly interpreted data.

There are inaccuracies in this topic related to Excel.
The possibilities of working with csv files in Excel without special import settings are very limited.
For example, you cannot open a utf-8 encoded csv file unless the file contains BOM.

The csv parser should be as unobtrusive as the user wants it to be. As a minimum, it should support UTC, and it would be reasonable to use the Calc Data acceptance patterns: D/M/Y;D/M (in my case):

The problem is in the detail but quickly:

  • D is 1…31 which may have a leading zero, Y is 2 or 4 numbers, M is the full word or maybe three characters
  • Irrespective, date is often YYYY/M/D format (either asian or a bastardised UTC format)
  • Separators could be anything in / .- or missing, and a month in words could be in another language

In my environment (ie the data I work with) it’s pretty simple to parse dates but I accept in places like Europe it is likely more complicated and users appreciate having a wizard take them through the process.
.
Annoyingly there isn’t even a suggestion any of these fields might be dates.

Sigh.
So many words, and not a single “this is a file; with these settings in Options, and these settings in CSV import, it imports like this, but I expect this”…

  1. If the settings are always the same, just hit Enter when the dialog pops up.
  2. You can link a document sheets to csv files with pre-defined import settings.
  3. Dozends of macros have been written to import text with hard coded preferences.
  4. There are several ways to handle csv by means of the Base component or by some database engine of your choice. [Example] Loading CSV into preformatted spreadsheets
1 Like

We use many csv files to store modelling input and output files from python pandas. Opening them with libre office is a bit of a pain because the menu with separator options appears each time. I understand it is a good idea to force users to check the import parameters. But for users who know what they are doing and once sensible defaults have been set, it would be useful if there was a way to remember them. In my case, the default are not remembered and the menu appears each time when I open the same file (I use it as a viewer to inspect data frames).

My fast work around when this menu appears is to press SHIFT + TAB + ENTER to go to the OK button and open the file.

In that case you should have a fairly controlled environment (unlike what @sijov1 describes for their situation), and the Base approach may work well for you. Did you try it? When you define a folder as a “CSV database” in Base, you select all those parameters once, and you’re done with it. Any new file pasted into that folder (or written, even dynamically updated, by other app) will appear as a new table in the database.

The settings are stored. All you have to do is hitting the Enter key [OK] when the dialog pops up.

menu:Sheet>Insert Sheet From File…
Check the “Link” option.
Import your csv file.
The import settings are store with the the sheet link.
Next time close the document, replace the file with the new one and re-open the file.

Csv is a database exchange format, a work-around when you can’t get access to the source database. I have seen users who export csv from a local database, load the csv into a spreadsheet for editing or whatever and then import csv back into the database. This is not necessary if you are able to connect a Base document with the database in quesiton.