The DIF File Format

This is a partial analysis of the DIF file format. It is probably incomplete, but will be updated for the needs of the IPD project.

File Header

The DIF file starts with a header consisting of a TABLE, VECTORS, TUPLES and DATA declaration. Each declaration consists of a tag, a type identifier and a data field. The declarations are formatted as:

	TAG
	TYPE,VALUE1
	VALUE2

This TABLE declaration appears to say which software produced the table. The only example I have has the string data "EXCEL".

The VECTORS declaration says how many records are contained in the file. In the examples I have, it has an integer value.

The TUPLES declaration appears to say how many fields there are per record. In the examples I have it has an integer value.

The DATA declaration is an unknown. In the examples I have it has an empty string value.

Tuples

Each field of a record consists of a type and a value. The type is a number, followed by a comma and the first of two values. In the file these are formatted as

	TYPE,VALUE1
	VALUE2

for each tuple. VALUE1 is used for integer values and VALUE2 for strings and specials.

STRING
Type identifier:
1
Value 1:
0
Value 2:
"data"
Comments:
Embedded quotes in the data are doubled
INTEGER
Type identifier:
0
Value 1:
Decimal value of field in ASCII format
Value 2:
V
BEGINNING-OF-TUPLE [SPECIAL]
Type identifier:
-1
Value 1:
0
Value 2:
BOT
END-OF-DATA [SPECIAL]
Type identifier:
-1
Value 1:
0
Value 2:
EOD

Author: David Byers Date: Feb 02, 1996