数字领域的领导失去为零,而在C#编写的CSV [英] Numeric fields lose leading zero while writing CSV in c#

查看:95
本文介绍了数字领域的领导失去为零,而在C#编写的CSV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的出口我的客户数据,以CSV ASP.NET应用程序,我需要我的客户电话号码要与前导零。
我需要的电话号码是没有 - 和不带引号,而且由于我的应用程序的性质,我不能使用第三方产品,如EPPLUS。
我试图把一个空间,让CSV理解,我需要的电话号码作为文本,但似乎并不正确。

I'm using an ASP.NET application which exports my clients data to CSV, I need my clients Phone number to be with the leading Zero. I need the phone numbers to be without "-" and without quotations, and due to the nature of my application I cannot use 3rd party products such as EPPLUS. I've tried to put a space and let the CSV "understand" that I need the phone number as text , but that doesn't seem right.

我想知道如何使Excel中包括前导零,而无需使用第三方产品。

I would like to know how to make the excel include the leading zero , without using 3rd party products.

感谢

推荐答案

更改与以下格式保存在CSV数据:

Change the data that is saved in the csv with the following format:

 ="00023423"

CSV例子

David,Sooo,="00023423",World

这将显示在Excel 00023423,而不是23423。

This will show 00023423 in excel and not 23423.

这篇关于数字领域的领导失去为零,而在C#编写的CSV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆