Escape or replace double quotes when converting from xls to csv [closed]

asked 2016-03-04 23:39:13 +0200

mikeg gravatar image

updated 2020-07-22 09:00:54 +0200

Alex Kemp gravatar image

I am trying to convert some .xls files .csv files using the command line on a Linux system (Ubuntu 14.04, LO v 4.2.8) using the following command

$ libreoffice "-env:UserInstallation=file:///tmp/LibO_Conversion" --headless --invisible --convert-to csv "$INFILE"

Unfortunately, I am running into problems doing this because some of the cells in the .xls file include text with double quotes (") and commas. As a result there are situations where it is ambiguous as to where a particular cell begins or ends in the .csv file I create. I am wondering if it's possible to pass arguments to LibreOffice during the conversion process so that the double quotes within a cell are converted to \" or even single quotes (').

Can anyone provide me with some suggestions on how to do this?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2020-07-22 09:01:08.925827


Test if doing first through the IU right, the options are retained for the command line.

m.a.riosv gravatar imagem.a.riosv ( 2016-03-05 01:00:56 +0200 )edit

Hmmm good idea. I might be able to figure out a work around using ';' as my separation value and making sure all cells are quoted. However, I don't see how I can indicate I want to do that using the command line. Any suggestions?

mikeg gravatar imagemikeg ( 2016-03-05 01:14:35 +0200 )edit

After you have getting from UI, try from command line, I think options used in UI are retained and used from command line.

m.a.riosv gravatar imagem.a.riosv ( 2016-03-05 01:19:44 +0200 )edit