Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

A (Python, but that's not really relevant) script I'm writing will issue a command line call to open a CSV file with OpenOffice (OO). I need OO to skip over the import dialog box while opening the script, or to tell OO that the defaults from that box are okay and thus the dialog is not needed.

Googling this has shown me stuff about setting up macros or a registered data source. Both of these seem to be overkill and are things I am clueless about.

Is there a command line option to tell OO to skip the dialog or use the defaults? Or some other simple way to accomplish what I need?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Perhaps if your Python script converted the CSV to another simple format (such as DIF) OpenOffice Calc would open it without needing a dialogue to confirm delimiters, column locations and column formats.

Update:

  • DIF doesn't work as OO asks what character encoding to use.
  • HTML doesn't work as OO asks what language to use.
  • SYLK works well

I used start run "D:\Apps\OpenOffice.org 3\program\scalc.exe" -calc d:\temp\table.slk to load this file

ID;P
C;Y1;X1;K"Row 1"
C;Y2;X1;K"Row 2"
C;Y3;X1;K"Total"
C;Y1;X2;K11
C;Y2;X2;K22
C;Y3;X2;K0;ER1C2+R2C2
E

With some effort your Python script can convert CSV files to temporary SYLK files on the fly.

share|improve this answer
    
Interesting idea: In fact, I could just work in another format as long as it can be imported/exported easily by other programs. Unfortunately, as you said DIF format still gets a dialog; Flat XML (saved by OO as a .fods, but it can be renamed to a .xml) avoids the dialog, but increases the file size by over 100 times in a simple example. –  GreenMatt Sep 30 '11 at 14:18
    
@GreenMatt: Answer updated - SYLK looks a good candidate. –  RedGrittyBrick Sep 30 '11 at 14:48
    
Using SYLK works. Thanks! –  GreenMatt Oct 3 '11 at 12:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.