Talk:Data Interchange Format

Add topic
Active discussions


UntitledEdit

I have added a bunch of technical information I found from Wotsit. --KevinKor 20:38, 5 March 2006 (UTC)


WikificationEdit

Done in July 2006 according to talk page history. Delsion23 (talk) 16:05, 23 January 2013 (UTC)

Navy DIFEdit

I'm not sure if this is any relation to Nav DIF, but if it is, maybe we should add a reference. Info: http://findarticles.com/p/articles/mi_m0CMN/is_n1_v22/ai_601504 66.191.19.217 14:43, 14 November 2007 (UTC)

From One of the DevelopersEdit

Here is a little information to start. Since I was associated with the original project, I will not edit the main page.

DIF is a data interchange format developed by Software Arts, Inc. in the early 1980s (the developers of the VisiCalc program). The specification was included in many copies of VisiCalc and also published in Byte Magazine in article authored by people on behalf of Software Arts, including one of its employees. Bob Frankston developed the format, with input from others, including Mitch Kapor, who helped so that it could work with his VisiPlot program. (Mitch later went on to found Lotus and make Lotus 1-2-3 happen.) The specification was copyright 1981. If you find an old copy of VisiCalc you might find in the manual a copy of the spec. There is a lot of explanation there about what it was designed for, how to use it, etc.

As can be verified by the USPTO trademark database, DIF was a registered trademark of Software Arts Products Corp. (a legal name for Software Arts at the time).

--DanBricklin (talk) 20:40, 25 June 2008 (UTC)Dan Bricklin

Another reference: http://www.atarimagazines.com/compute/issue25/105_3_NEW_PRODUCTS_SOFTWARE_ARTS_ESTABLISHES_DATA_INTERCHANGE_FORMAT.php

--DanBricklin (talk) 03:55, 26 June 2008 (UTC)

More specification details?Edit

Hey, I was working on a decoder for this, and it occurs to me the Wiki page could do with more details on the format as it took some working out. For a start, It seems to work by starting at the top left and working right until a newline is encountered and the process continues until it reads EOD. The pair of numbers that appear regularly seem to work by the first number being a command: -1 : Newline 0  : Value, the second number is the value 1  : Everything normal, move onto next table entry

The second number seems to be a value, which is ignored if the first number is a -1 or 1. The BOT command seems to be something to occupy space, while VECTORS and TUPLES seem to specify the table's width and height respectively. The DIF file format seems relatively simple going by this, are there more details in it's specification that I'm missing?— Preceding unsigned comment added by 84.203.123.12 (talk) 12:22, 28 September 2009

Moved this into its own section. I believe that, rather than inserting it into DanBricklin's comment, was the intention. I figured this was worth doing particularly since that comment is listed as one of the article's sources.--Mathieu ottawa (talk) 01:00, 28 April 2013 (UTC)

Official original specifications.Edit

Before it got lost in time and space, here is the original specification file I found on a Visicalc disk I had at home. I once published in this article, but as it's technical, it got deleted. Either way, I'd like this information to persist as it is valuable to developers working with legacy systems, so I'd like to know what would be the best, or the "least bad way" to place it in the main article so that developers might find it.


The DIF File Structure
DIF (Data Interchange Format) is a program-independent method of storing data. DIF files are ASCll text files. The format uses a brief line length to make the files as universally compatible as possible with application software, languages, operating systems and computer hardware.
  A DIF file is oriented towards row-and-column data, such as a spreadsheet or data-base manager might produce. Because individual programs may "rotate" the rows and columns, DIF uses the terms vector and tuple. You may generally interpret vector as column and tuple as row.  DIF files contain two sections: a file header and a data section.

The DIF Header

There are four required entries in the DIF header, and a number of optional entries. The format of all header entries is

  < topic >
  < vector # > , < numerical value >
  " < string value > "

  where

  < topic > is a "token," generally 32 characters or fewer.
  < vector # > is O if specifying the entire file.
  < numerical value > is O unless a value is specified.
  < string value > is "" (double quotations with no space between) if it is not used.

The first required item in a DIF file is the title. For a typical spreadsheet, this would look like:

  TABLE
  0, < version # >
  " < title > "

  where

  < version # > is 1.

   < title > is the title of the table.

                     
The next required item is the vector count. This specifies the number of vectors (columns). Its format is

  VECTORS
  0, < count >

  where
   < count > is the number of vectors. This entry may appear anywhere in the header, but must appear before any entries that specify vector numbers.

The third required item is the tuple count. This specifies the length of the vectors (the number of rows). Its format is

  TUPLES
  0, < count >

  where
   < count > is the number of tuples.

The final required header item is DATA, which specifies the division of the header information from the data proper. DATA must be the last header item. Its format is:

  DATA
  0,0

Optional Header Items
Other header entries are optional. DIF Clearinghouse has included optional entries.  Some are "standard" as a result of their being used in particular software products. The optional header entry items are: label, comment, field size, time series, significant values, and measure.

   - Permits enhanced description of a vector
     COMMENT
- Labels a specific < vector # > , < line # >
       " < comment > "
  LABEL
   < vector # > , < line # >
   " < label > "" < comment > "

   where
   < vector # > is the label < vector # > is the commented vector.
   < line # >'allows for labeling more than one < line # > may refer to more than one line.
   < label > is the label string.< comment > is the comment string.

   
   - Allocates fixed field sizes for each vector
   
     SIZE
     < vector # > , < # bytes >
   
     where
     < vector # > is the vector being sized.
     < # bytes > is the size.
   
   - Specifies the period in a time series:
   
     PERIODICITY
     < vector # > , < period >
   
     where
     < vector # > is the specified vector.
     < period > is the time period.
   
   - Indicates first year of a time series:- Indicates first period of a time series:
   
     MINORSTART
     < VeCtOr # ) , < Start )< vector # > , < start >
   
     where
     < vector # > is the specified vector.
     < start > is the start of the time series.
   
     
     - Indicates the portion of a vector that contains significant values:
     
       TRUELENGTH
       < vector # > , < length >
     
       where
       < vector # > is the specified vector.
       < length > is the length of that vector that contains significant values.
     
     - Units of measure for a given vectoc
     
       UNITS
       < vector # > ,0
       " < name > "
     
       where 
       < vector # > is the specified vector.
       < name > is the name string of the units to be applied.
     
     - Units in which a given vector should be displayed:
     
       DISPLAYUNITS
        < vector # >,0
       " < name > "
     
       where
        < vector # > is the specified vector.
        < name > is the name string of the units used to display the vector. (This may be different from the units used to measure the vector.)
     
DIF Data Section
The data section is organized in a series of tuples. Data within each tuple is organized in vector sequence. Essentially, using a spreadsheet as a data model, this means one data entry to a cell, in ascending column position, then by ascending row position.
  There are two "special data values," BOT (Beginning of Tuple) and EOD (End of Data). BOT marks the start of each tuple. EOD terminates the DIF file.
  Each data entry is organized in the following manner

  < type indicator >, < numerical value >
  < string value >

  where
  < type indicator > is one of three different indicators:

        -1       special data value
                 < numeric value > is O
                 < string value> is BOT, EOD
         O       numeric data (signed decimal number)
                 < numeric value > is numeric data
                 < string value > is one of the Value Indicators
                 (see below)
         1       string data
                 < numeric value > is O
                 < string value> is string data

Value Indicator

There are five value indicators to use as the < string value> when the
<type indicator> = 0:
            V       value

            NA      not available
                    < numeric value > must be O

            ERROR   error condition
                    < numeric value > must be O
            TRUE    < numeric value > is 1
            FALSE   < numeric value > is O