Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert CSV to XLS using 'ssconvert' with delimiter

I've got a CSV file with delimiter character being |, but can't really find a way to convert it to XLS that would apply the delimiter.

ssconvert -O 'separator=|' test.csv test.xls

will obviously yield with message like:

The file saver does not take options

The outcome is an XLS file with entire rows treated as one column (concatenated, like in text format) instead of spread according to given delimiter. Expected outcome is obviously properly delimited file.

It's been bothering me for a while, could anybody give me a hint?

like image 515
Patrick Avatar asked Mar 06 '15 09:03

Patrick


People also ask

How do I use delimiter in a CSV file?

Using the "From Text" feature in ExcelClick the Data tab, then From Text. Select the CSV file that has the data clustered into one column. Select Delimited, then make sure the File Origin is Unicode UTF-8. Select Comma (this is Affinity's default list separator).

Can CSV file have different delimiter?

A CSV file stores data in rows and the values in each row is separated with a separator, also known as a delimiter. Although the file is defined as Comma Separated Values, the delimiter could be anything. The most common delimiters are: a comma (,), a semicolon (;), a tab (\t), a space ( ) and a pipe (|).

What is delimiter for XLSX file?

xlsx). For CSV it is comma(,) but for excel files is 'Tab' or 'Pipe'?

Which character can be the delimiter in CSV file?

with a character such as a comma (,). This character is called the field separator or delimiter. When the field separator (delimiter) is a comma, the file is in comma-separated (CSV) or comma-delimited format. Another popular delimiter is the tab.


1 Answers

Unfortunately, option parameters can only be specified for the exporter, not the importer.

But you can replace the delimiter characters | with TABs, so that ssconvert recognizes columns.

tr '|' '\t' <test.csv | ssconvert fd://0 test.xls
like image 200
Armali Avatar answered Sep 30 '22 11:09

Armali