Formatters

When producing lists of results, whether from the command line or from the web application, the output can be in a variety of formats.

Ordinarily, the command line writes CSV data to the console, but if an output file is selected with the -out option, it can select a more appropriate file format based upon the file extension. The user can override this choice with the -format option.

Ordinarily the web application displays a table on an HTML page. This is a part of the web application and includes styling and navigation buttons. The web application provides buttons to return the data on display in other formats.

Data is written/returned in UTF-8 encoding.

Flat-file

You can choose to output CSV (comma-separated-value), TSV (tab-separated-value) and PSV (pipe-separated-value) formats.

Any NULLs in the data are written as empty strings.

CSV and similar flat-file formats have many variations. When writing a flat-file, Tabulator writes the first row containing attribute names. It doesn't write any comment lines. It quotes values containing seperator, \ or " characters.

JSON

You can output a JSON file.

The structure of the file is :-

[
  {
    "attrName1" : attrValue1,
    "attrName2" : attrValue2,
    ... more attributes
  },
  ... more results
]

NULL values are displayed as null.

Due to limitation of JSON, +Infinity, -Infinity and NaN Float and Double values are rendered as null also.

JSON has no native representation of any date, time or datetime related types, so these are just rendered in their ISO 8601 forms as string data.

The output produced should be compatible with the JSON file source.

Standalone HTML

This produces a standalone HTML page, with no dependency on the Tabulator web application.

XML

You can output an XML file.

The structure of the file is :-

<?xml version="1.0" encoding="UTF-8"?>
<results>
  <typeName>
    <attrName1>attrValue1</attrName1>
    <attrName2>attrValue2</attrName2>
    ... more attributes
  </typeName>
  ... more results
</results>

The typeName tag name is made by taking only the letter and digit characters from the type name.

The attrName tag names are made by taking only the letter and digit characters from the attribute names.

If an attribute value is NULL, its attribute tag doesn't appear.

Beware: Not every character that can be represented in a 16 bit java char can be written to an XML file, even using the &#number; numeric entity notation. So some characters are silently dropped. See the relevant part of the XML specification.

The output produced should be compatible with the XML file source.