Excel更改日期格式 [英] Excel changes date formats

查看:130
本文介绍了Excel更改日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行一个过程来产生一个相当大的CSV数据文件。有时我觉得在Excel中打开CSV有用,手动更改,然后重新保存。但是,如果CSV中有日期,excel会自动重新格式化它们。有没有办法防止excel这样做?

I run a process to produce a rather large CSV file of data. Sometimes I find it helpful to open the CSV in excel, make changes manually, and then re-save. However, if there are dates in the CSV, excel automatically reformats them. Is there a way to prevent excel from doing this? It would be helpful if I could turn off all text formatting altogether.

推荐答案

如果您预先添加一个撇号 '到导出过程中任何日期字符串的开头,Excel将按字面(即纯文本)读取值,而不是尝试将其转换为日期。

If you prepend an apostrophe ' to the beginning of any date string during the export process, Excel will read the value literally (i.e. as plain text) rather than trying to convert it to a date.

此特定解决方案在导出过程中处理。我不知道如何更改Excel以便在运行时处理该文件。

This particular solution is handled during the export process. I'm not sure how you would change Excel to treat the file differently at runtime.

这篇关于Excel更改日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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