[Solved] CSV Import formats the data incorrectly

Discuss the spreadsheet application
Post Reply
Ultra
Posts: 2
Joined: Wed Jan 30, 2019 1:34 pm

[Solved] CSV Import formats the data incorrectly

Post by Ultra »

I'm using Calc to edit CSV tables used with Magento 2.

When importing the CSV, the preview displays the data correctly, however when imported the data is changed.

Image

Image
Last edited by Ultra on Wed Jan 30, 2019 3:35 pm, edited 1 time in total.
OpenOffice 4.1.5 on Windows 10 Pro
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: CSV Import formats the data incorrectly

Post by jrkrideau »

I must be going blind but I do not see the difference between the .csv and .ods .
LibreOffice 7.3.7. 2; Ubuntu 22.04
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: CSV Import formats the data incorrectly

Post by Lupp »

It's very strange.
a) You chose the comma as the (only) field separator, but the preview is showing commas inside the third and forth field-column of the shown part.
b) BUT you don't address this obvious issue, but complain about "changed value". I cannot tell for sure, but assume the column BQ2 of your sheet is supposed to contain what was imported from the third column shown in the preview.
Please be so kind to explain what you expected, and how you got the paradox addressed under a).
c) IF your cell BQ 2 was imported from the previewed csv, and your settings (Dansk local) use the comma as the decimal separator, the shown result should be expected. It displays the number to the maximum resolution a spreadsheet number can be expected to give significant decimal digits (15). Assuming the cell has no explicit alignment, the left aligned header and the right aligned content of BQ2 back the guess this was the case.
d) If you want to import what looks like a number from csv as a text, you need to rightclick on the column header in the preview and choose that option.

Explainingto a bit more detail: The third shown column should be supposed to be kept together by a pair of doublequotes in the csv. Nonetheless it gets imported as a number under 'Standard' recognition.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: CSV Import formats the data incorrectly

Post by Villeroy »

I think, the 2 long numbers are in double-quotes. They are meant to be one text.
Check option "Quoted fields as text".
And always check "Detect special numbers".
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ultra
Posts: 2
Joined: Wed Jan 30, 2019 1:34 pm

Re: CSV Import formats the data incorrectly

Post by Ultra »

Villeroy wrote:I think, the 2 long numbers are in double-quotes. They are meant to be one text.
Check option "Quoted fields as text".
And always check "Detect special numbers".
Thank you. Those checkboxes did the trick.
OpenOffice 4.1.5 on Windows 10 Pro
ApacheOO
Posts: 1
Joined: Mon Feb 22, 2021 8:05 pm

Re: [Solved] CSV Import formats the data incorrectly

Post by ApacheOO »

Thank you so much for the solution :bravo:
OpenOffice 4.1.8 on Windows 10 @ Magento Development Company
Post Reply