2

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.

pnuts
  • 58,317
  • 11
  • 87
  • 139
corinna
  • 629
  • 7
  • 18

1 Answers1

4

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.

markus w
  • 56
  • 3
  • Works perfectly as shell script, but I was not able to make it run directly from command line. – corinna Nov 16 '17 at 14:39
  • Can you type the following line ... echo "" | od -c ... and get the following output ? 0000000 \t \n 0000002 I can type this under normal bourne shell ("/bin/sh") without any escape characters, but I need a -V before the when I use /bin/bash. How to enter the depends not only on the shell. Other Layers (XClient, Terminal...) can also "eat the tab away" for something else (like expansions, command completion ...) – markus w Nov 16 '17 at 17:38