Whole document tree
    

Whole document tree

File Formats

10.3. File Formats

In the Save as.. dialog you can choose between various file formats. (see Figure 10-1)

Similarly, in the Import.. dialog you can also choose between various file formats. (see Figure 10-2)

Most of these formats are provided by plug-ins. If they don't appear on your list of available plug-ins use the Tools Plug-ins... menu item to verify that the appropriate plug-in has been loaded.

10.3.7. HTML File Formats

These formats are supported by the "HTML & TeX" plug-in.

10.3.8. LaTeX 2e Format

This format is supported by the "HTML & TeX" plug-in.

Note

This format is only available when saving files.

Only the top sheet of the current workbook is exported.

The created LaTeX file can either be input into another LaTeX file (see Section 10.3.8.1) or latexed independently. See the content and Section 10.3.8.2 of the created file for various customization options.

Example 10-5. Saving as LaTeX file

The screenshot Figure 10-3 shows an example Gnumeric file. If we save this file as LaTeX file, tex it using pdflatex and open it using xpdf we obtain Figure 10-8.

10.3.13. Text Format

This format exports Gnumeric spreadsheets as straight text or imports them from straight text files. Both export (save as) as well as import can be highly customized.

10.3.13.2. The Text Import Druid

After specifying the "Text File Import" Format and a file name in the "Import.." dialog, the text import druid starts to guide you through the various options.

On the first screen of the druid specify the basic format type (fixed width fields or fields separated by specific characters), as well as the line numbers of the lines to import.

10.3.13.2.1. The Text Import Druid for Separated Fields

  1. Select the appropriate field separator(s) in the "Separator" frame. Select the "See two separators as one"option if any sequence of separators are supposed to be considered a single separator. The "Example" frame gives immediate feedback on your choices:

  2. Finally select the appropriate format for each input column:

    After selecting a column on the left select the appropriate format on the right. In the preview section at the bottom of the dialog, you can immediately see the effect of selecting that format. The following types of formats are available:

    General

    This format will guess for each field value whether it is text, a number, a date, etc.

    Numbers

    You can choose between various number formats. The following list presents just a short selection of those formats:

    There are also formats facilitating the use of scientific notation, see Figure 10-21.

    Currency Amounts

    You can choose between various currency formats. The following list presents just a short selection of those formats:

    Dates and Times

    You can choose between various date and time formats. Some of these formats will recognize combined date/time entries. The following list presents just a short selection of those formats:

    Percentages

    You can choose between various formats that recognize percentages. The following list presents just a short selection of those formats:

    Fractions

    You can choose between a few formats that recognize fractions. The following list presents just a short selection of those formats:

    Scientific Notation

    You can choose between a few formats that recognize numbers in scientific notation.. The following list presents just a short selection of those formats:

    Text

    If you want the importer to simply read the field value as text without attempting to interpret it in any way, use the following text format:

    More details on the various formats can be found in Section 9.1.1.

  3. Click the "Finish" button to complete importing the file.

10.3.14. TROFF Format

This format is supported by the "HTML & TeX" plug-in.

Note

This format is only available when saving files.

Files in this format are useful because they can be converted with the groff or troff commands into various other common formats. For example, given a TROFF file myfile.me, the command

  groff -me -t -Tps myfile.me >myfile.ps
  

will create a postscript file of the corresponding table.

Similarly, the command

groff -me -t -Tascii myfile.me >myfile.ascii
  

creates an ascii (straight text) file.

Example 10-6. Creating an ASCII File

If we save Figure 10-3 as a troff file hypothetical-sales.me and then execute the command

groff -me -t -Tascii hypothetical-sales.me >hypothetical-sales.ascii
  

then the file hypothetical-sales.ascii contains:







Sheet 0


+----------+------------------+-------------+------------+---+
|          | Operating System |             |            |   |
+----------+------------------+-------------+------------+---+
|          |       DOS        |    Linux    |    SCO     |   |
+----------+------------------+-------------+------------+---+
|  January | $1000.00         | $900.00     | $500.00    |   |
+----------+------------------+-------------+------------+---+
| February | $900.00          | $2500.00    | $300.00    |   |
+----------+------------------+-------------+------------+---+
|    March | $800.00          | $4100.00    | $100.00    |   |
+----------+------------------+-------------+------------+---+
|    April | $700.00          | $5700.00    | ($100.00)  |   |
+----------+------------------+-------------+------------+---+
|      May | $600.00          | $7300.00    | ($300.00)  |   |
+----------+------------------+-------------+------------+---+
|     June | $500.00          | $8900.00    | ($500.00)  |   |
+----------+------------------+-------------+------------+---+
|     July | $400.00          | $10500.00   | ($700.00)  |   |
+----------+------------------+-------------+------------+---+
|   August | $300.00          | $12100.00   | ($900.00)  |   |
+----------+------------------+-------------+------------+---+
|September | $200.00          | $13700.00   | ($1100.00) |   |
+----------+------------------+-------------+------------+---+
|  October | $100.00          | $15300.00   | ($1300.00) |   |
+----------+------------------+-------------+------------+---+
| November | $0.00            | $16900.00   | ($1500.00) |   |
+----------+------------------+-------------+------------+---+
| December | ($100.00)        | $18500.00   | ($1700.00) |   |
+----------+------------------+-------------+------------+---+
|          |                  |             |            |   |
+----------+------------------+-------------+------------+---+
|  Totals: | $5400.00         | $116400.00  | ($7200.00) |   |
+----------+------------------+-------------+------------+---+
|          |                  |             |            |   |
+----------+------------------+-------------+------------+---+

















                              1