Keywords: teapot

Subsections

- File names
- File Formats
  - XDR (.tp)
  - ASCII (.tpa)
  - CSV (.csv)
  - SC SpreadsheetCalculator (.sc)
  - Lotus 1-2-3 (.wk1)
  - Formatted ASCII (.txt)
  - Troff tbl (.tbl)
  - LATEX (.latex)
  - ConTEXt (.tex)
  - HTML (.html)

## Saving and Loading

### File names

Usually, you want to overwrite the loaded file. For this reason, the loaded file name is remembered. If the sheet doesn't have a file name, like after starting an empty sheet, you will be asked for a name when saving.

Occasionally, you may want to rename a sheet, like before making critical changes or when you load an existing sheet to have a start for making a new one. The Save As function allows you to save the file under a new name.

### File Formats

#### XDR (.tp)

XDR (eXternal Data Representation) is a standard invented by Sun Microsystems which defines a canonical way of storing/transporting data on external media. Its advantage is that it is widely available and that it defines a portable floating point number format. The native teapot file format uses XDR so it is portable across different machine architectures and operating systems. The advantage of this over the portable ASCII format is that due to the (usually) missing conversion calculations any floating point constants will be saved/loaded exactly without conversion errors.

#### ASCII (.tpa)

The ASCII file format allows easy generation/modification of saved sheets by shell scripts. Due to binary/ASCII conversion, there may be conversion errors in floating point constants. The default extension is `.`tpa.

#### CSV (.csv)

CSV (comma seperated value) files only contain the data, not the expressions calculating it. Many spread sheets can generate this file format and many graphics programs like gnuplot(1) can read it. The field separator usually is a tab or comma, strings may be enclosed in double quotes and decimal numbers have a dot to mark the fractional part. One popular variation uses semicolons for separating fields and a decimal comma instead of a decimal point, which teapot tries to autodetect.

On load, strings without quotes and with a 0x prefix followed by hexadecimal digits will be converted to integers. When loading CSV files, the sheet will not be cleared and the data will be load relative to the current cursor position.

#### SC SpreadsheetCalculator (.sc)

teapot can load simple SC sheets to convert them to teapot's native format. While loading, teapot converts all references to absolute cell positions to labels. This allows to insert and delete in such sheets without screwing the whole sheet up. teapot can not save sheets in SC format, because SC lacks many features. For now, only the most basic SC features are supported.

#### Lotus 1-2-3 (.wk1)

teapot can load simple WK1 sheets to convert them to teapot's native format. By default, 1-2-3 cell references are relative, so don't be surprised by a big amount of relative references in the resulting teapot sheet. For now, only the most basic 1-2-3 features are supported.

#### Formatted ASCII (.txt)

The generated formatted ASCII files contain about what you see on the screen. If your sheet has more than one layer, then the various layers will be saved separated by form feeds.

#### Troff tbl (.tbl)

teapot can generate tbl(1) table bodies in single files which are supposed to be used like this:

> `.TS`
> options`;`
> `.so` filename
> `.TE`

You will have to use soelim(1) to eliminate the `.so` requests before the tbl run. The options`;` are optional. If you use GNU roff, you will need to eliminate `.lf` requests, because this GNU roff extension confuses GNU tbl:

> `soelim` file `| grep -v '^\.lf'`

Alternatively, you can generate a stand-alone document, which needs no further operations to format and print. Note: If no block is marked, the whole sheet will be saved.

#### LATEX (.latex)

If you generate LATEX2e tables in single files, you include them in documents using the `\include` command. Alternatively, you can generate a stand-alone document, which needs no further operations to format and print. Note: If no block is marked, the whole sheet will be saved.

#### ConTEXt (.tex)

Analogous to LATEX output, this generates input suitable to the ConTEXt macro package.

#### HTML (.html)

You can generate html table bodies in single files which could be used in combination with server-side includes. This feature differs between the various servers, so refer to the manual for your web server for details, please.

Alternatively, you can generate a stand-alone document. Note: If no block is marked, the whole sheet will be saved.