Status

The most current version of this document is available at http://www.flightlab.com/~joe/flightlab/tabfile.html; a PostScript version is available at http://www.flightlab.com/~joe/flightlab/tabfile.ps.

Tabular file format

Last updated: Monday 17 May 1999, 11:08 PDT



1 Overview

The .TAB file format is designed to store numeric data sets in a format that is easier for human beings to read, write, and edit than the Scope ``SAVE'' and ``READ'' formats.

TAB files can store multiple scalar, vector (1-D), and matrix (2-D) data quantities, and can make explicit the relationship between different variables (for example, that in a table of aerodynamic properties, CL, CD, and CM are functions of ALPHA).

2 File format



TAB files consist of one or more records; each record specifies one or more variables. Each variable has a name, and can be a scalar, vector, or matrix quantity. Variable names are case-insensitive, and follow the usual Scope naming conventions (must begin with a letter and contain only letters and digits). Each variable in the file must have a unique (with the exception of the index variables in .I records).

There are several different record types; see below. Directives are lines beginning with an exclamation point; directives specify the format of succeeding data lines.

Lines are at most 255 characters long.

2.1 Comments

A comment directive is an exclamation point followed by a blank or a tab. Any line beginning with a comment directive is ignored. In addition, lines beginning with a pound sign (#), and those consisting of a single exclamation point, are also ignored.

2.2 Table records

Table records contain multiple columns of data. Each column is a single variable. Table records begin with a !T directive:

!T var1 ... varN
r1c1 r1c2 ... r1cN
...
rMc1 rMc2 ... rMcN

The rIcJs are floating-point numbers. Each data row must contain the same number of elements. The varI specify the variable names. Each variable is an M-long vector, containing the values rIc1 ... rIcM.

2.3 Indexed table records

briefly: same format as Table records; must have at least two columns; variables var2.. varN are M by 2, with (:,1) = var1, (:,2) = varJ.

This format is useful if there are multiple groups of dependant variables which share the same independant variable.

2.4 Matrix records

Matrix records contain a single 2-D variable. Matrix records begin with a !M directive:

!M varname
r1c1 r1c2 ... r1cN
...
rMc1 rMc2 ... rMcN

3 Scope language interface (proposed)

The LOADTAB command reads .TAB files. The simplest form:

LOADTAB("filename.tab")
reads all of the variables stored in filename.tab, and stores each as a Scope variable in the current group.

If more arguments are supplied:

LOADTAB("filename.tab", var1 [, ... varN])
then LOADTAB only loads the specified variables var1 ... varN. It is an error if any of these are not found in the data file.

4 C language interface

See tabfile.h.

5 Future enhancements

TODO: 5 Aug 1998