Fielded text

Fielded text

Fielded Text is a proposed standard which provides structure and schema definition to text files which contain tables of values (for example, CSV files). The standard allows the format and structure of the data within the text file to be specified by a "Meta" file. This Meta file can then be used to access the data in the file in manner similar to which data is accessed in a database.

Meta files

The Meta files are XML files/streams which describe how the fielded text file is structured and how the data in fields is formatted. The information it contains in analogous to the Meta information for a database.

The Meta contains the following groups of information
* Main Section which specifies properties applying to the whole text file.
* Field Sections which specify the properties of each field of data used within the text file
* Substitution Sections which specify which substitutions are used within the text file. Substitutions are similar to Escape Sequences used in some CSV files (eg ).
* Sequence Sections. A Fielded Text file can have lines with different sets of fields depending on the value of a key field(s). The Sequence Sections in the Meta File specify the sequence of fields which can follow a key field.

Meta files typically have a file extension of "ftm"

Declared and Undeclared Fielded Text files

A Fielded Text file can be either declared or undeclared.

A Declared Fielded Text file starts with 2 special lines which reference the Meta associated with the text file. The Meta reference can either be a URI, a file or embedded within the Text File as comments. Declared Fielded Text files always begin with the characters "|!Fielded Text^|" (without quotes) to identify the files as a declared Fielded Text file. A file extension of "ftx" is often used for Declared Fielded Text files. The standard also proposes that the MIME type text/fielded be used to identify Fielded Text data streams.

An Undeclared Fielded Text file does not start with the 2 special lines. It is not implicitly associated with a Fielded Text meta file/stream. Applications need to explicitly associate a Meta file with an undeclared Fielded Text file in order to determine its structure and format. Existing CSV, Fixed Length field and other text files containing table(s) of values are undeclared Fielded Text files.

Basic Example

Below is a basic CSV file. It has 2 heading lines and 4 data lines. The lines contain 7 fields of various types. "Pet Name", "Age", "Color", "Date Received", "Price", "Needs Walking", "Type" , (Years), , , (Dollars), , "Rover", 4.5, Brown, 12 Feb 2004, 80, True, "Dog" "Charlie", , Gold, 5 Apr 2007, 12.3, False, "Fish" "Molly", 2, Black, 12 Dec 2006, 25, False, "Cat" "Gilly", , White, 10 Apr 2007, 10, False, "Guinea Pig"

The following Fielded Text Meta file specifies the structure and layout (schema) of the above text file.

Following is a Declared Fielded Text file which contains the above CSV text together with the its meta embedded as comments. The ~ character specifies a comment line. ~|!Fielded Text^| Version="1.0" ~ MetaEmbedded="True" ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "Pet Name", "Age", "Color", "Date Received", "Price", "Needs Walking", "Type" , (Years), , , (Dollars), , "Rover", 4.5, Brown, 12 Feb 2004, 80, True, "Dog" "Charlie", , Gold, 5 Apr 2007, 12.3, False, "Fish" "Molly", 2, Black, 12 Dec 2006, 25, False, "Cat" "Gilly", , White, 10 Apr 2007, 10, False, "Guinea Pig"

Capabilities

The Fielded Text standard aims to provide sufficient capabilities to handle nearly all existing text files containing tables of values while keeping the schema of the Meta as simple as possible. The following list summarises the capabilities of the Fielded Text standard:
*Fields separated by a delimiter character
*Fixed Length Fields
*Mixed Fixed Length and Delimiter separated fields in a line
*Quoted Fields (Optional or Explicit)
*New Lines in Quotes
*Automatic New Line detection or specified New Line character
*Comments
*Ignoring Blank Lines
*Ignoring extra characters/fields in lines
*Handling language cultures
*Multiple Heading Lines (both delimited and fixed length)
*Substitutions (escape sequences)
*Embedded (Stuffed) Quote Characters
*Boolean, DateTime, Decimal, Float, Integer and String fields
*Field Heading Constraints
*Null fields
*Constant fields
*Specify format and styles of fields
*Lines can have different sequences of fields based on the value of “key” fields

pecification

The draft specification of the Fielded Text standard can be found at the [http://www.fieldedtext.org Fielded Text home page]

ee also

*CSV
*Delimiter-separated values

External links

* [http://www.fieldedtext.org Fielded Text home page]
*RFC 4180: Common Format and MIME Type for Comma-Separated Values (CSV) Files


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Text analytics — The term text analytics describes a set of linguistic, lexical, pattern recognition,extraction, tagging/structuring, visualization, and predictive techniques. The termalso describes processes that apply these techniques, whether independently or… …   Wikipedia

  • List of file formats — This is an incomplete list, which may never be able to satisfy particular standards for completeness. You can help by expanding it with reliably sourced entries. See also: List of file formats (alphabetical) This is a list of file formats… …   Wikipedia

  • Comma-separated values — Comma separated list Filename extension .csv or .txt Internet media type text/csv Type of format multiplatform …   Wikipedia

  • Delimiter-separated values — Formats that use delimiter separated values (also DSV)[1] store two dimensional arrays of data by separating the values in each row with specific delimiter characters. Most database and spreadsheet programs are able to read or save data in a… …   Wikipedia

  • Petron Blaze Boosters — For the ASEAN Basketball League team that now carries the old name, see San Miguel Beermen (ABL). Petron Blaze Boosters Joined PBA 1975 History Royal Tru Oran …   Wikipedia

  • Vehicles of the Imperium (Warhammer 40,000) — The following text describes vehicles used by the Imperium in the fictional Warhammer 40,000 universe. It includes mostly vehicles from the Warhammer 40,000 and Epic line of tabletop games. The Imperium of Man is composed of several armed… …   Wikipedia

  • Humvee — This article is about the military vehicle. For the defunct brand of civilian vehicles, see Hummer. Humvee United States Marine Corps HMMWV in difficult terrain in A …   Wikipedia

  • Qpids — Infobox Television show name = Qpids caption= Left to right: The Qpids Logo format = Interactive Reality Show runtime = Varies, see Show formats creator = Lauren Dyogi starring = See Cast country = Philippines network = ABS CBN first aired = May… …   Wikipedia

  • M4 Sherman — Medium Tank M4 An M4A3E8 76 mm armed Sherman tank made during the Second World War Type …   Wikipedia

  • Hattrick — Infobox VG title = Hattrick developer = Hattrick Limited. (The game originated with ExtraLives AB, and large parts of the continued development are still sub contracted to that company.) lead designer = originally Björn Holmér, now Johan… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”