Export #OmegaT Project to Excel

This post is about a script that exports OmegaT project to an XLS document with a separate worksheet for each source file.This script has been requested and kindly sponsored by cApStAn sprl

The scripts requires jxl.jar from JExcelApi located in the scripts folder (tested with version 2.6.10). Without the jar it won’t run.

The script itself needs to be downloaded here: write_excel_multiple_sheets.groovy.zip, and extracted to OmegaT scripts folder.

Each time the script runs, it creates a XLS file inside the script_output subfolder in your project’s folder. The filename will be based on the project name and language pair (for instance, Missale_Romanum (LA - SA).xls or omegat-ru (EN - RU).xls)

The first worksheet of the resultant XLS file is sort of a mastersheet with links to all the other sheets, which in a way is similar to Project Files window in OmegaT:

Project Files (56).png

omegat-ru (EN - RU).xls.png

Clicking on a filename or the sheet name in the list will get you directly to the corresponding file. To get back to the mastersheet, you need to click on the filename in the upper part of the sheet (B1).

File worksheet in xls.png

The script will inform about its results in OmegaT status bar and Scripting window console.

The script is localizable (so make sure you put the .properties file along with the script itself, either to properties subfolder, or on the same level where .groovy file is). Localization covers both script’s messages and a few captions in the resultant file.

Comments, suggestions, bug reports and friendly hugs are most welcome.

UPDATE: Briac Pilpre, whose ideas were used in the script, made a modification for a “horizontal layout” of the sheets, i. e. Segment # | Source | Target. His version can be found at this pastebin link. Setting the variable “threeColumnsStyle” to false in line 34 of the linked script (def threeColumnsStyle = false) restores the “vertical layout” of the output file. Thank you, Briac, for the original idea to use jxl library, and for the current addition.

But as of now,

Good luck


8 thoughts on “Export #OmegaT Project to Excel

  1. A big thank you for making this useful script, and congratulations and a friendly hug of course🙂

  2. I cannot make it work :S It says: Se está ejecutando el programa “/Applications/OmegaT_4.0.0_Beta_Mac/OmegaT.app/Contents/Java/scripts/write_excel.groovy”…
    Se produjo un error
    javax.script.ScriptException: java.lang.ClassNotFoundException: jxl.format.Alignment

    Even if I have jxl.jar into /scripts :S any idea?

    • My mistake, sorry.
      Line 36, where it says,
      def jxlJar = new File(Preferences.getPreferenceDefault(Preferences.SCRIPTS_DIRECTORY, “.”)+File.separator+”jxl*.jar”).toURI().toURL()
      remove that asterix in jxl*.jar
      I updated the script at SF.net repository, so you can redownload it just as well, but it’s the only change.

  3. Practical piece – I am thankful for the specifics – Does anyone know where my business might obtain a fillable a form copy to complete ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s