Sudo libreoffice --calc or -o filename.ods doesn't work

  • Problem in short :-
    I need to open, save as, and close .ods file from command line/ within a shell script.
  • Background Info :-
    I would create a formula.ods (say) supposed to contain formulas written so as to take raw data from (say) a temp.csv file, By copying diff files (say 1.csv, 2,csv, 3.csv etc) to the temp.csv file each time I hope to get the same set of calculations performed on diff bits of data. While opening the formula.ods would do the math on the temp.csv data. Then I can save as the file as a csv resembling the name of original file (say 1_result.csv, 2_result.csv, … ). I would like to save the results as .ods if I could somehow avoid the formula. otherwise they will all be the same! I am using LibreOffice 4.1 on Linux Mint 12 Lisa (Kernel -generic i686)
  • Problem :-
    Needless to say I can not do this manually - Ideally, I need to open and close about 1500 files in a matter of 1 to 1.5 hours (practically, I will be happy if I can get 250- 500). But I am stuck at the first step itself. sudo libreoffice --calc or sudo libreoffice -o formula.ods gives the error “The application can not be started. A General error occurred while accessing your central configuration.”
  • Tryouts so far :-
    On some other forums I saw sugestions to delete .libreoffice so I renamed it to .libreoffice_old but no use. The command created a new .libreoffice folder except that this one has execute permissions and the .libreoffice_old has rwx only for root.

Thanks for any/all pointers.

The use of sudo is not recommended. LO is designed to be run with user permissions.

I didn’t know that about LO. I was following another link. As answered below use of sudo is not required. This is to confirm what oweng has written, Regards,

  • Answered partly:-
    The command should be $libreoffice4.1 --calc filename.ods and the file opens. sudo is not required in my case.

  • Unanswered portion:-
    How to “save as” the opened up file from command prompt / shell script?
    Will get back if I can find something.