libreoffice-calc - 在 LibreOffice 中以无头模式将 csv 转换为 dbase
问题描述
我可以在 LibreOffice 中以常规模式将带有日期的 csv 文件转换为 dbase。H_beg 日期和 H_end_date 完美地工作。
dbview thexport.dbf
H event id : 210721001
H name : CCCR WEEK NIGHT 072121
H tot sect : 1
H beg date : 20210721
H end date : 20210721
H rcv date :
H ent date :
H aff id : A6000220
H city : ROCHESTER
H state : NY
H zipcode : 14621
H country : USA
H sendcros : N
H scholast : N
H secrec01 : 0
但是如果尝试在无头(批处理)模式下自动化操作,日期字段为空白!
bash 脚本: libreoffice --headless --invisible --convert-to dbf thexport.csv
dbview thexport.dbf
H event id : 210721001
H name : CCCR WEEK NIGHT 072121
H tot sect : 1
H beg date :
H end date :
H rcv date :
H ent date :
H aff id : A6000220
H city : ROCHESTER
H state : NY
H zipcode : 14621
H country : USA
H sendcros : N
H scholast : N
H secrec01 : 0
有任何解决这个问题的方法吗?
解决方案
sudo apt install unoconv
#!/bin/bash
cd /wherever/your_files_are/
unoconv thexport.csv thexport.dbf
unoconv tsexport.csv tsexport.dbf
unoconv tdexport.csv tdexport.dbf
推荐阅读
- python - 设置 Anaconda 环境的良好做法是什么?Linux中的环境变量
- bash - 分配由数组中的变量名称提供的系统变量
- excel - Alloweditusers 功能失败
- ruby-on-rails - Rails 关联和创建新记录
- python - 删除 python3.7 文件夹后点坏了
- typescript - Interface 和 InstanceType 有什么区别
什么时候作为一种变量? - javascript - require('electron').app 未定义 - 如何解决这个问题
- mysql - 当字段逗号分隔时,mysql如何搜索必要的删除日期
- angularjs - 角度:StaticInjectorError(ExplorationEditorPageModule)[String]
- android - 使 TextView 可在末尾使用省略号进行调整,以获得在辅助功能设置中选中的最大字体大小