CSV to XLS in UNIX commands w/out losing any data or format

Dear Community,

I have CSV file wich needs to be converted in XLS to be parsed by a Perl script. I don´t want to touch in the perl script so I am trying to convert the CSV into XLS format without losing anything. Using LibreOffice graphic interface I am able to do multiple conversions without losing any data/format.

176290 a.csv
using LibreOffice graphical interface I get
195584 a.xls
The file gets actually bigger (assuming no data is lost here)

Trying to do the same using UNIX command line:
libreoffice --headless --convert-to xls --infilter=“csv:44,34,UTF8” a.csv

I get a much smaller file
36471 a.xls

My question is, how to convert, through UNIX commands, a CSV file to XLS without losing anything ?

Appreciate any help.

Regards,
Filipe

Hello, what makes you assume that you have lost something through command line conversion? Is it just the different file sizes of the resulting .xls files from both methods?

Did you compare and determine the difference? What is it? Load one document and then use menu Edit → Track Changes → Compare Document… and open the second document.

And please edit your question to add details, do not use the answer/solution text input. Thanks.

Hi Opaque, not only the file size but also the fact I am using a script to process the .xls file and when I convert the .csv in .xls using command line that script is unable to process the converted xls file . Doing the conversion using LIbreOffice graphical interface there is no problem .i.e the script is able to process .xls file

Without a sample file to investigate the crystal ball is foggy…