如何防止前导零从我的CSV中的列中删除?
问题描述:
我需要上传一个CSV文件,但我的文本数据 080108
仍在转换为 80108
。
I need to upload a CSV file, but my text data 080108
keeps converting to a number 80108
. What do I do?
答
我在使用Microsoft Excel查看CSV时经常看到这个。 Excel将截断所有数字字段中的前导零。如果输出不是来自excel,那么请检查笔记本中的输出。如果是来自excel,您需要在每个邮政编码的开头添加一个单引号'
。那么excel将保留前导0。
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.