CSV导出:保留前导零 [英] CSV Exporting: Preserving leading zeros

查看:172
本文介绍了CSV导出:保留前导零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个.NET应用程序,导出CSV文件在Excel中打开,我有一个问题,当文件在Excel中打开时保留前导零。我使用的是 http://creativyst.com/Doc/Articles /CSV/CSV01.htm#CSVAndExcel

I'm working on a .NET application which exports CSV files to open in Excel and I'm having a problem with preserving leading zeros when the file is opened in Excel. I've used the method mentioned at http://creativyst.com/Doc/Articles/CSV/CSV01.htm#CSVAndExcel

在用户决定在Excel中保存CSV文件之前,这种方法非常有用。如果文件在Excel中再次打开,那么前导零会丢失。

This works great until the user decides to save the CSV file within Excel. If the file is opened again in Excel then the leading zeros are lost.

生成CSV文件时,我可以做些什么来防止这种情况发生。

Is there anything I can do when generating the CSV file to prevent this from happening.

推荐答案

这不是CSV问题。

这是Excel喜欢用CSV播放文件

将扩展名更改为其他内容。

Change the extension to something else.

这篇关于CSV导出:保留前导零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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