| View previous topic :: View next topic |
| Author |
Message |
andSam Newbie

Joined: 21 Jul 2011 Posts: 3
|
Posted: Thu Jul 21, 2011 6:46 am Post subject: Calc: Importing csv and running macro from Unix terminal |
|
|
Hi,
I am attempting to write a shell script to automate a series of processes, one of which is opening and processing a .csv file using a few VBA macros in Calc.
I have used the line
However when it opens the file a 'Text import' window opens requiring some user input to import the .csv.
This is an issue as the idea is to remove any user input from the process (it is intended to be run overnight). I have tried using the -headless command so the code looks like
| Code: |
oocalc -headless "test.csv"
oocalc "macro:///Standard.Module1.macro1"
oocalc "macro:///Standard.Module1.macro2"
|
Any thoughts on how to disable the menu that opens up on startup of Calc?
Thanks
Moderation probe1: moved to MACROS AND API section, where all macro related questions belong to; edited subject |
|
| Back to top |
|
 |
Robert Tucker Moderator


Joined: 16 Aug 2004 Posts: 3367 Location: Manchester UK
|
|
| Back to top |
|
 |
andSam Newbie

Joined: 21 Jul 2011 Posts: 3
|
Posted: Fri Jul 22, 2011 2:08 am Post subject: |
|
|
I have read through all of these and none seem to address the issue perfectly.
As it is part of an automated flow I need to remove all need for user input.
Ideally I would like some command line option that can force Calc to open the csv file with certain settings so the 'import settings' dialogue box doesn't appear. |
|
| Back to top |
|
 |
probe1 Moderator


Joined: 18 Aug 2004 Posts: 2478 Location: Chonburi Thailand Asia
|
Posted: Fri Jul 22, 2011 2:20 am Post subject: |
|
|
Have a look at the code from my macro insertCSV2Calc
| insertCSV2Calc wrote: | Inserting data from CSV file into a Calc table sheet
Documentation in ODT format (OOo2). Macros perform an automated way of importing a pre-defined structured, character delimited date file into new table. Customizable file extension, easy detection of filter options to by pass import dialogue with provided routine.
Example macro – source code needs changes! |
_________________ Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs |
|
| Back to top |
|
 |
andSam Newbie

Joined: 21 Jul 2011 Posts: 3
|
Posted: Fri Jul 22, 2011 2:56 am Post subject: |
|
|
Sounds perfect
i have downloaded the file but am wondering how I can actually get at the macro (newbie I know!) |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
|
| Back to top |
|
 |
|