|
|
|
Enhancing OOo Calc CSV files recognitionCSV files are widely used for data import/export with spreadsheets
Openoffice.org Calc can obviously handle them but restrict the handling of CSV-like files to only some extenstions (csv, txt, tab). The default behaviour is to open unknown files in Writer as plain text ones. Some months ago i gave the method for handling .dat files by default in OOo 1.1.x as CSV file [fr], so that they open directly in Calc. Here is the update for OOo 2.x : the sipirit remains the same, the details slightly changed Making the changes persistentThe filters definition in OOo 2.x are stored in /opt/openoffice.org2.0/share/registry/modules/org/openoffice/TypeDetection/Types An xcu file is an xml file used by OOo for its configuration In this directory, you'll find a lot of file dealing with OOo filters definition The one concerned bu our CSV defibnition is fcfg_calc_types.xcu Searching for csv string inside it, we will find this structure
<node oor:name="calc_Text_txt_csv_StarCalc" oor:op="replace" >
One can the notice that inside this calc_Text_txt_csv_StarCalc node, we find an Extensions property listing all the extension actually handled for csv files So, the solution is only to append dat or zzz to this property
<prop oor:name="Extensions"><value>csv txt tab dat zzz</value></prop>
Be carefull that this file is in the main OOo directory, not the user one, so you may need some writing rights on this file Deploying the solutionThanks to OOo configuration model and great package manager, one can deploy this configuration easillySeeing OOo Configuration as layers (share > User > Packages), we can then define a package taht the user will add using its Tools > Package manager The modified configuration will me merged to the Configuration XML tree provided the adminsitrator has not finalized the node This package is straightforward to create :
Here is the example that configures calc to open .dat aand .zzz file sby default once the pacakge installed <?xml version="1.0" encoding="UTF-8"?> Important announcement: Join the Nuxeo team and contribute to the Nuxeo project! We have open positions in France and the UK for open source Java EE developers and sales engineers, both junior and senior.
Posted by Laurent Godard @ 02/24/2006 11:30 AM.
-
Categories:
openoffice
-
12 comments
|
Nuxeo Bloggers: Log in! Search Nuxeo Blogs
About this blog
Laurent Godard
Nuxeo Bloggers
Photos and Pictures
|
|
Nuxeo -
Indesko -
Nuxeo 5 Project
All content is copyrighted by their author. CPSSkins is Copyright © 2003-2006 by Jean-Marc Orliaguet. | CPS is Copyright © 2002-2006 by Nuxeo SAS. |