You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决或忽略xlsx2csv的“Error: potential invalid date format”错误

解决xlsx2csv转换时"potential invalid date format"错误的方案

问题场景

通过LibreOffice将.ODS文件转换为.XLSX文件后,使用xlsx2csv工具导出XLSX中所有工作表为独立CSV文件(直接从ODS转CSV仅能处理第一个工作表),执行命令时触发错误。

执行命令与错误信息

执行的转换命令:

~$ ~/.local/bin/xlsx2csv -a "/home/username/Pictures/folder/folder/XLSXDepot/file.xlsx" "/home/username/Pictures/folder/folder/XLSXDepot"

返回错误:

Error: potential invalid date format.

排查情况

确认工作簿中无日期数据,推测是xlsx2csv误将数字或字符串识别为日期戳导致报错,针对1900年前日期的通用解决方案不适用。

解决方案

1. 正确使用--ignore-formats参数

--ignore-formats的有效取值包括date、time、datetime,可指定单个或多个值。正确的命令写法如下:

  • 忽略日期格式:
~/.local/bin/xlsx2csv -a --ignore-formats date "/home/username/Pictures/folder/folder/XLSXDepot/file.xlsx" "/home/username/Pictures/folder/folder/XLSXDepot"
  • 同时忽略日期和时间格式:
~/.local/bin/xlsx2csv -a --ignore-formats date time "/home/username/Pictures/folder/folder/XLSXDepot/file.xlsx" "/home/username/Pictures/folder/folder/XLSXDepot"

2. 完全禁用日期时间转换

如果上述参数无效,可使用--no-datetime-conversion参数彻底关闭日期时间转换逻辑:

~/.local/bin/xlsx2csv -a --no-datetime-conversion "/home/username/Pictures/folder/folder/XLSXDepot/file.xlsx" "/home/username/Pictures/folder/folder/XLSXDepot"

内容的提问来源于stack exchange,提问作者Tim50001

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 16:57:17