convert csv to xlsx command line UTF8 coding problem

classic Classic list List threaded Threaded
8 messages Options
Uwe Brauer Uwe Brauer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

convert csv to xlsx command line UTF8 coding problem


Hi

I run from the command line

/usr/bin/soffice --headless --convert-to xlsx test.csv

Which works nicely with ASCII code, however if the csv contains UTF8
the coding fails, the same is true for the ods format.
What can I do?

I am not sure whether the attachments pass the SPAM filter so here is
the mini csv
,----
|
| Apellido,Nombre,DNI,Gr
| Díaz ,Pepe,123456,F
`----

Thanks

Uwe Brauer





--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Michael D. Setzer II Michael D. Setzer II
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert csv to xlsx command line UTF8 coding problem

In the help it list options for infilter and filter options for convert-to.
Don't know if you would need one or both, and it does list UTF8, but don't
think the help shows all options.

LibreOffice 5.3.3.2 3d9a8b4b4e538a85e0782bd6c2d430bafe583448

Usage: soffice [options] [documents...]

Options:
--minimized    keep startup bitmap minimized.
--invisible    no startup screen, no default document and no UI.
--norestore    suppress restart/restore after fatal errors.
--quickstart   starts the quickstart service
--safe-mode    starts the safe mode
--nologo       don't show startup screen.
--nolockcheck  don't check for remote instances using the installation
--nodefault    don't start with an empty document
--headless     like invisible but no user interaction at all.
--help/-h/-?   show this message and exit.
--version      display the version information.
--writer       create new text document.
--calc         create new spreadsheet document.
--draw         create new drawing.
--impress      create new presentation.
--base         create new database.
--math         create new formula.
--global       create new global document.
--web          create new HTML document.
-o             open documents regardless whether they are templates or not.
-n             always open documents as new files (use as template).

--display <display>
      Specify X-Display to use in Unix/X11 versions.
-p <documents...>
      print the specified documents on the default printer.
--pt <printer> <documents...>
      print the specified documents on the specified printer.
--view <documents...>
      open the specified documents in viewer-(readonly-)mode.
--show <presentation>
      open the specified presentation and start it immediately
--language=<language_tag>
      Override the UI language with the given locale
      Eg. --language=fr
--accept=<accept-string>
      Specify an UNO connect-string to create an UNO acceptor through which
      other programs can connect to access the API
--unaccept=<accept-string>
      Close an acceptor that was created with --accept=<accept-string>
      Use --unnaccept=all to close all open acceptors
--infilter=<filter>[:filter_options]
      Force an input filter type if possible
      Eg. --infilter="Calc Office Open XML"
          --infilter="Text (encoded):UTF8,LF,,,"
--convert-to output_file_extension[:output_filter_name[:output_filter_options]]
[--outdir output_dir] files
      Batch convert files (implies --headless).
      If --outdir is not specified then current working dir is used as output_dir.
      Eg. --convert-to pdf *.doc
          --convert-to pdf:writer_pdf_Export --outdir /home/user *.doc
          --convert-to "html:XHTML Writer File:UTF8" *.doc
          --convert-to "txt:Text (encoded):UTF8" *.doc
--print-to-file [-printer-name printer_name] [--outdir output_dir] files
      Batch print files to file.
      If --outdir is not specified then current working dir is used as output_dir.
      Eg. --print-to-file *.doc
          --print-to-file --printer-name nasty_lowres_printer --outdir /home/user
*.doc
--cat files
      Dump text content of the files to console
      Eg. --cat *.odt
--pidfile=file
      Store soffice.bin pid to file.
-env:<VAR>[=<VALUE>]
      Set a bootstrap variable.
      Eg. -env:UserInstallation=file:///tmp/test to set a non-default user profile
path.

Remaining arguments will be treated as filenames or URLs of documents to
open.


On 22 Jun 2017 at 6:53, Uwe Brauer wrote:

To:             [hidden email]
From:           Uwe Brauer <[hidden email]>
Subject:         [libreoffice-users] convert csv to xlsx command
line UTF8 coding problem
Date sent:       Thu, 22 Jun 2017 06:53:59 +0000

>
> Hi
>
> I run from the command line
>
> /usr/bin/soffice --headless --convert-to xlsx test.csv
>
> Which works nicely with ASCII code, however if the csv contains UTF8
> the coding fails, the same is true for the ods format.
> What can I do?
>
> I am not sure whether the attachments pass the SPAM filter so here is
> the mini csv
> ,----
> |
> | Apellido,Nombre,DNI,Gr
> | Díaz ,Pepe,123456,F
> `----
>
> Thanks
>
> Uwe Brauer
>
>
>
>
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be deleted


+----------------------------------------------------------+
  Michael D. Setzer II -  Computer Science Instructor      
  Guam Community College  Computer Center                  
  mailto:[hidden email]                            
  mailto:[hidden email]
  Guam - Where America's Day Begins                        
  G4L Disk Imaging Project maintainer
  http://sourceforge.net/projects/g4l/
+----------------------------------------------------------+

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

BOINC@HOME CREDITS
ABC         16613838.513356 | EINSTEIN   133913302.288695
ROSETTA     60333252.687309 | SETI       104587492.242787


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Uwe Brauer Uwe Brauer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert csv to xlsx command line UTF8 coding problem

>>> "Michael" == Michael D Setzer <[hidden email]> writes:

   > In the help it list options for infilter and filter options for
   > convert-to. Don't know if you would need one or both, and it does
   > list UTF8, but don't think the help shows all options.

Thanks

I tried

/usr/bin/soffice --headless --utf-8 --convert-to xlsx test.csv

In various order but obtained
Unknown option: --utf-8


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Michael D. Setzer II Michael D. Setzer II
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert csv to xlsx command line UTF8 coding problem

The help shows no --utf-8 option, it is a filter not an option?


I think this is what it would look like? Not sure of the LF,,, part of it?


/usr/bin/soffice --headless --infilter=Text (encoded):UTF8,LF,,,--convert-to xlsx test.csv




On 22 Jun 2017 at 7:30, Uwe Brauer wrote:


To:[hidden email]
From:Uwe [hidden email]
Subject:[libreoffice-users] Re: convert csv to xlsx
command line UTF8 coding problem
Date sent:Thu, 22 Jun 2017 07:30:28 +0000


Michael== Michael D [hidden email]:


In the help it list options for infilter and filter options for
convert-to. Don't know if you would need one or both, and it does
list UTF8, but don't think the help shows all options.


Thanks


I tried


/usr/bin/soffice --headless --utf-8 --convert-to xlsx test.csv


In various order but obtained
Unknown option: --utf-8




--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted




--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Uwe Brauer Uwe Brauer
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert csv to xlsx command line UTF8 coding problem

>>> "Michael" == Michael D Setzer <[hidden email]> writes:

   > The help shows no --utf-8 option, it is a filter not an option?
   > I think this is what it would look like? Not sure of the LF,,, part of it?


   > /usr/bin/soffice --headless --infilter=Text (encoded):UTF8,LF,,,--convert-to xlsx test.csv

Thanks I tried it out in various variations

/usr/bin/soffice --headless --infilter="Text(encoded):UTF8" --convert-to xlsx test.csv  

But the encoding is still broken.


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

robert leleu robert leleu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert csv to xlsx command line UTF8 coding problem

Je la 22/06/2017 10:44, Uwe Brauer skribis :

>>>> "Michael" == Michael D Setzer <[hidden email]> writes:
>     > The help shows no --utf-8 option, it is a filter not an option?
>     > I think this is what it would look like? Not sure of the LF,,, part of it?
>
>
>     > /usr/bin/soffice --headless --infilter=Text (encoded):UTF8,LF,,,--convert-to xlsx test.csv
>
> Thanks I tried it out in various variations
>
> /usr/bin/soffice --headless --infilter="Text(encoded):UTF8" --convert-to xlsx test.csv
>
> But the encoding is still broken.
>
>
I had recently a coding problem (for PHP .htaccess), because my
favourite text editor "gedit" handles only UTF8
I was able to understand and solve using "medit", a text editor
available through synaptic in my Ubuntu 17.04. It allowed me to chane
the code of the file, which I switched to "occidental", and so made
visible all the UTF8 characters (or parts of)

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Paul D. Mirowsky Paul D. Mirowsky
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert csv to xlsx command line UTF8 coding problem

In reply to this post by Uwe Brauer
|iconv -f utf-8 -t ascii//TRANSLIT|

This may allow you to pipe/redirect into your soffice command.

There is also

|konwert utf8-ascii|

at https://sourceforge.net/projects/konwert/

However it is unclear how the command is used with a file name.

I have not tried either, but may work for you.

Hope this helps


On 6/22/2017 2:53 AM, Uwe Brauer wrote:

> Hi
>
> I run from the command line
>
> /usr/bin/soffice --headless --convert-to xlsx test.csv
>
> Which works nicely with ASCII code, however if the csv contains UTF8
> the coding fails, the same is true for the ods format.
> What can I do?
>
> I am not sure whether the attachments pass the SPAM filter so here is
> the mini csv
> ,----
> |
> | Apellido,Nombre,DNI,Gr
> | Díaz ,Pepe,123456,F
> `----
>
> Thanks
>
> Uwe Brauer
>
>
>
>
>


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Paul D. Mirowsky Paul D. Mirowsky
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: convert csv to xlsx - konwert man page

http://www.unix.com/man-page/debian/1/konwert/



On 6/22/2017 10:46 AM, Paul D. Mirowsky wrote:

> |iconv -f utf-8 -t ascii//TRANSLIT|
>
> This may allow you to pipe/redirect into your soffice command.
>
> There is also
>
> |konwert utf8-ascii|
>
> at https://sourceforge.net/projects/konwert/
>
> However it is unclear how the command is used with a file name.
>
> I have not tried either, but may work for you.
>
> Hope this helps
>
>
> On 6/22/2017 2:53 AM, Uwe Brauer wrote:
>> Hi
>>
>> I run from the command line
>>
>> /usr/bin/soffice --headless --convert-to xlsx test.csv
>>
>> Which works nicely with ASCII code, however if the csv contains UTF8
>> the coding fails, the same is true for the ods format.
>> What can I do?
>>
>> I am not sure whether the attachments pass the SPAM filter so here is
>> the mini csv
>> ,----
>> |
>> | Apellido,Nombre,DNI,Gr
>> | Díaz ,Pepe,123456,F
>> `----
>>
>> Thanks
>>
>> Uwe Brauer
>>
>>
>>
>>
>>
>
>


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Loading...