简体   繁体   English

我保存时,带有Excel的TSV缩短了几秒钟

[英]TSV with Excel clipping off seconds when I save

I am trying to edit a TSV file in excel. 我正在尝试在Excel中编辑TSV文件。 When I simply open it and then ctrl-s to save it, I notice when I open it in a text editor that the seconds has been clipped off. 当我简单地打开它,然后按ctrl -s保存它时,我注意到当我在文本编辑器中打开它时,秒数已被截断。 Before opening the file I have: 08/15/2015 18:26:07 but after I have 8/15/15 18:26 . 打开文件之前,我有: 08/15/2015 18:26:07但之后有8/15/15 18:26 It's okay that it is clipping off the preceding zeros, but I need the seconds to remain intact for my program. 可以截断前面的零,这是可以的,但是我需要几秒钟来保持程序的完整性。

Any suggestions/ideas? 有什么建议/想法吗? I'd prefer to use excel if possible. 如果可能,我宁愿使用excel。

You may have to adjust the default date/time format in your Excel format settings before saving. 在保存之前,您可能需要在Excel格式设置中调整默认日期/时间格式。 To change the date/time format, goto menu Format, Cell, Time and pick one that has seconds. 要更改日期/时间格式,请转到菜单格式,单元格,时间,然后选择一个具有秒数的格式。 If none meet your needs, try the custom format and then type this format: 如果没有一个可以满足您的需求,请尝试使用自定义格式,然后键入以下格式:

dd/mm/yyyy hh:mm:ss

I figured out how to do this specifically when dealing with TSV files. 我想出了如何在处理TSV文件时专门执行此操作。 When you open the file and go through the 'text wizard' steps, on the third step, you need to go through each column and tell it to format it as text, rather than as general, which is the default (and lets excel guess what format everything should be). 当您打开文件并执行“文本向导”步骤时,在第三步中,您需要遍历每一列,并告诉它将其设置为文本格式,而不是常规格式,这是默认设置(让Excel猜测一切应该是什么格式)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM