Excel的CSV,包括前导零和逗号 [英] CSV for Excel, Including Both Leading Zeros and Commas
问题描述
我想为用户生成一个CSV文件以使用Excel打开它。
I want to generate a CSV file for user to use Excel to open it.
如果我想在值中转义逗号,我可以写为 640,480。
If I want to escape the comma in values, I can write it as "640,480".
如果我想保留前导零,我可以使用=001234。
If I want to keep the leading zeros, I can use ="001234".
但是如果我想保留逗号和前导零的值,写作= =001,002将拆分为两列。
But if I want to keep both comma and leading zeros in the value, writing as ="001,002" will be splitted as two columns. It seems no solution to express the correct data.
有没有办法在Excel的CSV中表示 001,002 ?
Is there any way to express 001, 002 in CSV for Excel?
推荐答案
Kent Fredric的回答包含解决方案:
Kent Fredric's answer contains the solution:
"=""001,002"""
(我无法将此发布为单独的答案,因为肯特的答案不清楚这是一个有效的Excel解决方案。
(I'm bothering to post this as a separate answer because it's not clear from Kent's answer that it is a valid Excel solution.)
这篇关于Excel的CSV,包括前导零和逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!