问题
I need to upload a CSV file, but my text data 080108 keeps converting to a number 80108. What do I do?
回答1:
Use Quoted CSV
Use quotes in your CSV so that the column is treated as a string instead of an integer. For example:
"Foo","080108","Bar"
回答2:
I have seen this often when viewing the CSV using Microsoft Excel. Excel will truncate leading zeros in all number fields. if the output is not coming from excel then check the output in note pad. If it is coming from excel you need to add a single quote mark ' to the beginning of each zip code. then excel will retain the leading 0.
来源:https://stackoverflow.com/questions/14074305/how-can-i-prevent-leading-zeroes-from-being-stripped-from-columns-in-my-csv