使用ssconvert从.xlsx创建TAB分隔值

时间:2017-11-13 10:07:02

标签: linux excel csv tabs gnumeric

由于单元格值中包含逗号,我无法使用proc sort data=foo; by id; data sum_value_over_id_v2(keep=id total); do until (last.id); set foo; by id; total = sum(total, value); end; run; 实用程序进行ssconvert到csv转换。是否有可能使用.xls(x)(命令行电子表格格式转换器)直接从xlsx创建制表符分隔值?

ssconvert  引发ssconvert infile.xlsx outfile.tsv错误。

因此,我试图在一些导出选项的规范下生成原始文本文件,特别是分隔符:

Unable to guess exporter to use

导致类似ssconvert -O 'separator=\t format=raw' infile.xlsx outfile.txt的输出,即字符串value1\tvalue2\tvalue3未转换为制表符。

有什么建议吗?

1 个答案:

答案 0 :(得分:1)

从shell脚本调用时:在允许的引号之间放置一个真正的制表符,例如:

ssconvert -O 'separator="   " format=raw' infile.xlsx outfile1.txt
ssconvert -O "separator=\"  \" format=raw" infile.xlsx outfile2.txt
ssconvert -O "separator='   ' format=raw" infile.xlsx outfile3.txt

要直接在命令shell中键入ctrl-v,可能需要使用该选项卡。 用鼠标粘贴它可能会失败,因为选项卡将被空格替换。

相关问题