我有以下代码
awk test1 > out.xsl
mail -a out.xsl "Test Subject" abc@gmail.com < /dev/null
So I have a file in csv format and i need to convert it into excel when the mail is being sent. I do receive the mail but it gets corrupted when I try to open it. Test1 is a CSV file and Iam converting it in excel file named out.xsl. Iam sending the excel file in mail but Iam not able to open it or view anything inside it Please help
最佳答案
使用unoconv
:
unoconv -i FilterOptions=9,,76 -f xls tables.csv
这里 9 是用作字段分隔符的制表符,76 是代码页 (UTF-8)。
(unoconv
不支持 xlsx
,仅支持 xls
)。
或者使用xlsxwriter
编写一个简单的Python脚本:示例是here .
关于linux - 在邮寄过程中通过 shell 脚本将 csv 转换为 Excel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43648932/