top of page
Bücherregal als Symbolbild für den Blogbeitrag.

Blog

What is a TSV file?

You are probably familiar with CSV files, but what is a TSV file? Microsoft is increasingly providing this TSV format in its products as an export option or for log files.


TSV means "tab-separated-values" and can be summarized as follows:

The TSV format is structured in the same way as a CSV file - just with a tab as the field separator.


Prename  Surname Place
Andrea Steiner Bern
Hans Meier "Berlin → Mitte"
Peter Müller Paris
Sandra Weber Wien

TSV file format

TSV files are plain text files with the appropriate file extension, where the data is displayed in a simple tabular form using tabulator characters (see example above).

Each line of text corresponds to a data record with fields or columns which are separated by a horizontal tabulator (ASCII code 9). If required, field content can be enclosed with a text delimiter such as a double quotation mark as soon as a comma or line break is part of the field content (see example with "Berlin, Mitte").


No official standard

As for CSV files, there is no official standard for TSV files either. The CSV format is only fundamentally described in RFC 4180 from IETF. The smasi CSV-Wizard from 2S-Software can be of help here in correcting the formats for the desired target application.


Advantages and disadvantages

Advantages

  • TSV files can be easily created and read in any text editor.

  • Due to the small number of control characters, the text files are quite lean.

  • Unlike CSV files, at least the field separator is fix defined as a tabulator in TSV files.

Disadvantages

  • The TSV format is less suitable for structured content or nested tree structures. In this case, JSON or XML files are the preferred format.

  • In addition, TSV files cannot be validated and there is no official standard.

  • Compared to a Microsoft Excel document, a TSV file cannot contain multiple sheets and does not support formatting or formulas.


Application purpose of a TSV file

Compared to CSV files, TSV files are not as widely used, although the file format is similar. Microsoft is increasingly providing the TSV format in their tools as an export option for certain log files or Azure exports.

If necessary, you can easily convert TSV files to CSV files with the smasi CSV Wizard by changing the separator from a tabulator to a comma.


Recommendation

It is recommended to use the RFC 4180 format description with the horizontal tab as the separator. Here is the recommendation from practice:

  • The first line should include the appropriate headings for all columns.

  • As soon as a tabulator or a line break is contained in a field content, double quotation marks should be used. Otherwise, it should be avoided.

  • A number is to be displayed without a thousand separator.

  • A date is to be mapped in SQL format (YYYY-MM-DD hh:mm:ss).


Looking for a TSV Editor or TSV Viewer?

Any CSV editor that supports tabs as separators can be used to edit or display a TSV file. This means that the smasi CSV Wizard can also be used for TSV files without any problems.


 

More information




Recent Posts

Komentar


bottom of page