简体   繁体   English

如何将csv列视为日期时间

[英]How to treat csv column as date-time

I have a CSV file where one of the columns is a string representation of a date in the form 'dd.mm.yy@hh:mm:ss'. 我有一个CSV文件,其中一列是日期的字符串表示形式,格式为“ dd.mm.yy@hh:mm:ss”。 I want excel to read this as a date format, so it can sort, filter, etc. How can I do that? 我希望Excel以日期格式读取它,以便它可以排序,过滤等。我该怎么做?

Use the Data / Text to columns wizard. 使用“数据/文本到列”向导。

  • Step 1: Delimited 步骤1:定界
  • Step 2: Delimiters Other: @ 步骤2:分隔符其他:@
  • Step 3: Select the first column (the date part) and for Column Data Format select Date: DMY 步骤3:选择第一列(日期部分),对于列数据格式,选择日期:DMY

You will probably have to reformat the date column by removing the hyperlink and then applying the desired date format 您可能必须通过删除超链接然后应用所需的日期格式来重新格式化日期列

The above could be automated, if necessary. 如有必要,可以自动执行上述操作。

If you need both in the same column, you can add them. 如果在同一列中需要两者,则可以添加它们。

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

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