Share via

Microsoft Excel Corrupts Data in CSV files

Anonymous
2013-05-20T10:21:37+00:00

When using Excel 2013 to save as CSV where a column contains UPC codes (e.g., 802464395902), the file is successfully saved and the data is stored correctly in the CSV file.

When the CSV file is reopened, the value 802464395902 is changed to 8.02464E+11.

If the file is saved the new value will automatically replace the original value and all UPC codes in the file are now invalid.

The issue appears to affect a variety of different numbers.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2013-05-20T13:06:41+00:00

    In this case I didn't actually have to type anything.  I just simply open the file and click 'save'.  All the data will be automatically corrupted by Excel.

    3 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-05-20T13:17:14+00:00

    How can I possibly ensure every end user won't accidentally open the files by double clicking the file?  Data corruption is a serious issue and it's nearly impossible to police all the end users who will potentially interact with this data.  Especially it is not obvious what is happening.  They may not even notice this until the file has been used for some time and by then it will be difficult to merge back the original uncorrupted data.

    Interestingly enough, the data will remain intact if stored in Excel format.  The data only becomes corrupted if saved in CSV format.

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2013-05-20T11:16:46+00:00

    The problem occurs when the .csv file is re-imported into Excel.  If you re-open the file by double-clicking its icon or by using the:

    File > Open dialog, Excel tries to "help" you by changing the formats.  You can avoid this by using the Text or Data Import Wizard from the Data Tab.

    You can tell the Wizard that the files are Text

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2013-05-20T14:28:56+00:00

    The situation is actually even worse!

    If you format A1 as Text and enter:

    33290586791094818922 <br><br> <br><br>and save the file as .csv <br><br> <br><br>All will seem O.K.  You can open the csv file with NotePad and verify the value is correct.  If you open the csv file by double-clicking it, you should see in A1: <br><br> <br><br>33290586791094800000.   I get around this by appending some character to the end of really big numbers to disable Excel's bad behaviour.
    0 comments No comments
  5. Anonymous
    2013-05-20T11:06:22+00:00

    Hi,

    in order to avoid this,

    before you type

    say, in column A

    you might format the specific column, as Text

    in this way, you can have

    0987654321

    0123456789

    001234

    0000001

    0 comments No comments