Le 16/06/07, Thoraval Yvon <[EMAIL PROTECTED]> a écrit :


Bonjour à tous(tes) !


Bonjour,


je souhaite faire un petit script shell qui ouvre un fichier csv (compte en
banque) avec le point-virgule ";" comme séparateur et Windows-1252/WinLatin1
comme encodage texte.

sur Mac OS X en shell script on ouvre ce document par :

$ open /path/to/fichier.csv si OOo est réglé comme appli par défaut pour
les fichiers csv

ou par :

$ open -a OpenOffice.org 2.2.app  /path/to/fichier.csv si OOo n'est pas
l'appli par défaut.

ça marche très bien mais OOo ouvre alors une fenêtre de dialogue pour
choisir le séparateur et l'encodage.

je cherche donc une solution, s'il elle existe pour ouvrir ces documents
sans cette fenêtre de dialogue c'est-à-dire avec, par exemple, des options
spécifiant le séparateur et l'encodage.

est-ce possible ?


en cherchant un peu j'ai trouvé un argument qui permet de connaître les
options possibles lorsqu'on lance OOo en ligne de commande depuis un
terminal X11 :
<terminal X11>
aputeaux-154-1-72-65:/Applications/OpenOffice.org
2.2.app/Contents/MacOS/program
chezmoi$ ./soffice -?
OpenOffice.org 2.2  680m18(Build:9161)

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 (only available on windows
platform)
-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 userinteraction at all.
-help/-h/-?   show this message and exit.
-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
-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-sring>
     Close an acceptor that was created with -accept=<accept-string>
     Use -unnaccept=all to close all open acceptors
Remaining arguments will be treated as filenames or URLs of documents to
open.
aputeaux-154-1-72-65:/Applications/OpenOffice.org
2.2.app/Contents/MacOS/program
chezmoi$
</terminal X11>
Je n'y vois rien qui permette de spécifier l'encodage ou la séparateur :-(.
Il y a peut-être d'autres solutions.

Yvon


Manuel

Répondre à