Opening my own data files in Calc

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
rantrod
Posts: 1
Joined: Mon Aug 18, 2008 4:57 am

Opening my own data files in Calc

Post by rantrod »

Hi, I wanna use Calc to open some data files of mine. The data files are pretty simple text files. There's a good reason why I don't save the data files in the open office format or xml. I want to be able to double-click on my data file, and have it open in Calc, putting the data in the appropriate cells. It gets a little more complicated, though. Let's say my data file is called table.Dat - When I double-click on table.Dat, I want a particular Calc file I have to open up in Calc, say, C:\Work\MyFormattedCalcFile.ods. Then have the data in table.Dat "fall-in" the appropriate cells in the C:\Work\MyFormattedCalcFile.ods Calc app. The file C:\Work\MyFormattedCalcFile.ods is a template file that has all the settings I want for that data (validation lists, cell calculations, etc). Does this sound complicated?

Thanks!
OOo 2.3.X on Ms Windows XP
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Opening my own data files in Calc

Post by TheGurkha »

Hi and welcome to the forums.

Yes, this sounds complicated, if not impossible.

I can't see how Calc would know which spreadsheet to open when you clicked the .dat file. You could presumably associate .dat files with Calc so Calc opened if you double clicked one, but how you would then get Calc to change its focus and load another spreadsheet is probably the stumbling block. And you'd have to have some clever macros in that spreadsheet to then go back and read in the data from the original 'clicked' file.

It might be more realistic (and even then still a challenge) to open the spreadsheet directly and to have a macro that allowed you to select the data file you wished to use. That's well beyond my shaky grasp of macros. Maybe the best you can hope for is for someone else to come along and say, 'No - there's an easy way to do it!' :)
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
User avatar
foxcole
Volunteer
Posts: 1507
Joined: Mon Oct 08, 2007 1:31 am
Location: Minneapolis, Minnesota

Re: Opening my own data files in Calc

Post by foxcole »

rantrod wrote:Let's say my data file is called table.Dat - When I double-click on table.Dat, I want a particular Calc file I have to open up in Calc, say, C:\Work\MyFormattedCalcFile.ods
This is above the application level of processing. Calc doesn't make file associations, the OS does. TheGurkha's suggestion of opening the Calc file and having a script automatically run to load the .dat file is the only alternative.
Cheers!
---Fox

OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
ms777
Volunteer
Posts: 177
Joined: Mon Oct 08, 2007 1:33 am

Re: Opening my own data files in Calc

Post by ms777 »

rantrod,

which OS are you on ?

If you are on M$ Windows, maybe http://www.oooforum.org/forum/viewtopic ... 143#177143 is of help

Good luck,

ms777
Post Reply