0

Hi,

I have imported a csv file but for some reason in some values the data after . is missing
for e.g.
If my value in csv is 0.5 it displays 0. and 5 went missing
but in my csv file i have value as 0.5
I don't what step i am missing on import.

Edited by code_rum

5
Contributors
9
Replies
50
Views
4 Years
Discussion Span
Last Post by code_rum
0

Did you specify column types or let it auto generate? Can you post the table schema?

0

Please specify where did you imported the CSV.

NOTE: If you have imported in MySQL, check your datatypes, if it's INT it will chunk it, you should use float, double or decimal in this case.

Edited by Szabi Zsoldos

0

I have imported in MySQL

I had let it auto generate...so it gives datatypes as varchar(2)

Then i changed the datatype to float (11,4)
On again importing csv the datatype is now float but the data which was 0. it now shows 0.0000
Still 5 is missing from the data

Edited by code_rum

0

Please post the table scheme, maybe it's a problem of the ID and you are trying to import the data in the wrong column.

You can try the HeidiSQL which gives you feedback upon each error.

0

On again importing csv the datatype is now float but the data which was 0. it now shows 0.0000

Well it will as the 5 wasn't stored in the first place. If you run the csv import again, it should work.

0

I agree with diafol, if you truncate the table and keep the modified schema, then re-import the file into that table it should work.

0

I tried running csv import again but didn't helped.
I was saving my .ods file to .csv and don't know what was wrong with it but it always show me an error
Invalid column count in CSV input on line 1 Error.
I checked my column count and it was correct.
Then i tried Google spreadsheet and saved it as .csv and there it gets imported properly into database.
Solved but wasn't able to figure out the problem.

Edited by code_rum

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.