Alan Pope wrote:
In some other tools I've used "\t" (sans quotes) to indicate a tab.
Dunno if that works in xls2csv though.
I tried that originally, but no joy. It ends up in the document as just "t".
I also tried \t and various quoting.
Jan T. Kim wrote:
In an interactive bash, use Ctrl-V to quote the tab (i.e. to protect it from being interpreted as a request of command / filename completion).
This is a general feature of interactive programs based on readline, I believe.
I didn't know this trick, but it did allow me to put the tab into the commandline. My first attempt failed since I didn't quote it (and the commandline interpreter stripped the whitespace), but putting it in quotes did work. So thanks - that seems to be what I need.
I did previously try -c$(echo -ne '\t') .. but that didn't work for exactly the same reasons; sure enough had I thought to try: -c"$(echo -ne '\t')" .. that also works.
Which makes it all sort of academic since I'll actually build the commandline from a PHP script so inserting a genuine TAB will be no problem, but the Ctrl-V trick is a good one to know about. Thanks!
[Background: I got tired of telling people to convert their XLS files into tab-separated-variable files because its surprising just how frequently they screw that up. Combining a proprietary file format with a user is a recipe for failure!]