Search code examples
tabsexport-to-csvimport-from-excelgnumericssconvert

Creating TAB-separated values from .xlsx with ssconvert


Due to commas within cell values, I am not able to use the ssconvert utility for .xls(x) to .csv conversion.

Is there a possibility to create tab-separated values directly from xlsx with ssconvert (command line spreadsheet format converter)?

ssconvert infile.xlsx outfile.tsv raises the error:

Unable to guess exporter to use

Hence, I have tried to generate a raw text file under specification of some export options, in particular, the separator:

ssconvert -O 'separator=\t format=raw' infile.xlsx outfile.txt

which results in output like value1\tvalue2\tvalue3, i.e., string \t is not translated into tabulator.


Solution

  • When called from a shell-script: Put a real tab-character between allowed quotes, e.g:

    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
    

    To type this directly into a command shell a ctrl-v before the tab might be necessary. Pasting this with the mouse will probably fail, as the tab will be replaced by spaces.