Description: On csv-import LO interprets specific cells as numeric (and remove leading 0), while other cells in same col are text. Actual Results: Import CSV with col PW and 2 lines. PW-line1=affenzahn, PW-line2=00654 Result after import is affenzahn, 654 Expected Results: expected: affenzahn, 00654 Reproducible: Always User Profile Reset: No Additional Info: do not play with results.
This is not a bug. CSV is a plain-text format for data interchange. If some value in it may be interpreted as number, and not quoted, then *by default* it should be treated as number, which happens here. It doesn't matter if previous line contained a text in that position: that night be a table header, or some intermediate summary. If you need to have some column treated as text, just right-click the relevant column title *at CSV import dialog*, and select "Text". Closing NOTABUG. Please feel free to reopen if you disagree; if so, then please describe your reasons.
1) Sry, the imported values *are* quoted. 2) Who invented your default behavior? 3) In my opinion importing should never change values by default ("0054320" -> 54320) 4) see also RFC 4180
(In reply to tes from comment #2) > 1) > Sry, the imported values *are* quoted. This is what should have been stated from the start; please provide a sample to test; and also mention which settings are active in the CSV import dialog. Mention your version information (as per Help->About LibreOffice). Your initial description haven't mention that, and values in examples were unquoted. Provided that information, we could try to understand if that is wrong behavior, but I don't get your following question: > 2) > Who invented your default behavior? Well - *if* you argue with me on the grounds that I declared it correct to convert *quoted text* looking like numbers - then you are arguing with what has never been declared here. If, however, you tell me that you have doubts in logic behind converting *unquoted* numbers to numbers - then I simply fail to understand your logic. Without treating unquoted numbers as numbers, you would simply have *all* data from CSV as text - because, well, initially that's all text. RFC 4180 does not specify any treatment of data inside the records, it only tells about syntax.
Created attachment 145754 [details] examples and sysinfo
Created attachment 145755 [details] example1
Created attachment 145756 [details] example2
Created attachment 145757 [details] example3
Created attachment 145758 [details] Versioninfo
Created attachment 145759 [details] ImportDlg
(In reply to Mike Kaganski from comment #3) > (In reply to tes from comment #2) > > 1) > > Sry, the imported values *are* quoted. > > This is what should have been stated from the start; please provide a sample > to test; and also mention which settings are active in the CSV import > dialog. Mention your version information (as per Help->About LibreOffice). > Your initial description haven't mention that, and values in examples were > unquoted. Sry for my inaccuracy. > ...Without treating unquoted numbers as numbers, > you would simply have *all* data from CSV as text - because, well, initially > that's all text. In my opinion the best default setting. thank you for your attention
Created attachment 145764 [details] Video showing how can the import can be made keeping all text In this video you can see that Libre Office offer you the chance to keep the second column as text. Please see the video. So this is not a bug.
(In reply to BogdanB from comment #11) > Created attachment 145764 [details] > Video showing how can the import can be made keeping all text > > In this video you can see that Libre Office offer you the chance to keep the > second column as text. > > Please see the video. > > So this is not a bug. Dear Bogdan, thanks for your effort, creating the video. I already knew this "solution". I'm speaking about the default handling. The other way around is a shoe out of it. In my opinion the "default" has to be *text*. *NO* automatic interpreting/formating of data to import.
Never change data *automatic* on importing by a glance in the crystal. CSV *IS* plain text! Nothing else. Use XML, DBF or something else if you want formated columns.
Created attachment 145769 [details] screenshot comparing excel 2016 and lo 6.1.3.1 csv import attached screenshot shows result for excel and lo csv import. to make excel import csv data, i had to replace comma , with semicolon ;
(In reply to Oliver Brinzing from comment #14) > Created attachment 145769 [details] > screenshot comparing excel 2016 and lo 6.1.3.1 csv import > > attached screenshot shows result for excel and lo csv import. > > to make excel import csv data, i had to replace comma , with semicolon ; Dear Oliver, very nice. Additionally MS decided ; is better than ,. Bullshit on top. The MS behavior seems to be the same compared to LO. Both systems changes content automatically on loading where they don't have to do.
Please use "Format quoted field as text" checkbox to treat quoted values as text. See https://help.libreoffice.org/latest/en-US/text/shared/00/00000208.html#hd_id314847422. (In reply to tes from comment #10) > > ...Without treating unquoted numbers as numbers, > > you would simply have *all* data from CSV as text - because, well, initially > > that's all text. > > In my opinion the best default setting. The best *default* setting is the one that works best for most cases for non-techy majority of users. Fir them, opening a CSV and being unable to sum values would be unexpected. Given the wast variety of in-the-wild CSV flavors, with huge inconsistencies and nuances, we provide defaults targeted at that group, and versatile dialog with telling labels. People who can read RFCs are expected to be able to guess the meaning of "Format quoted field as text".
I close this as WONTFIX, because I have described the reason behind the default behavior. We *won't* change the default in a way that will harm more people than those who would benefit.
(In reply to tes from comment #13) > CSV *IS* plain text! Nothing else. Use XML, DBF or something else if you want formated columns. This is bullshit. 1. If you treat CSV as plain text and nothing else, then please *DON'T* use spreadsheet software to work with it. 2. If you can give such bold advises as to "Use thos or that if you want formated columns", then please be so kind to force different external bodies (like banks and governments) that user doen't have much influence to stop offering numeric tabular data in CSVs.