hoger qassim hoger qassim - 3 months ago 16
SQL Question

How to avoid automatically change data type in .CSV file

I have created an application in java language and I have used MySQL as a DBMS. I have a button in this application which export my data to .CSV file.

The problem is that when I open .CSV file, it automatically change the data. For example,

00001
will becomes
1
.

How can I avoid automatically change data type in excel?

Answer

If you open the *.csv directly in Excel, then all columns will be read as type general (means there is an automated guessing for the value type).

If you import the file as text into the current sheet you can specify the value delimiter and also the type of each column.

Comments