Delimiter

From Free net encyclopedia

Template:Cleanup-date

Delimiters are marks which are used to separate subfields of data.

The types of delimiters heavily depend on the data types and formation. For example a character can be used to divide fields in a string. Or an integer for dividing fields in an integer array.

The delimiter(s) should not be used as a part of the data.

To be a delimiter, a mark should have a constant value which is not used inside the data values.

In the simplest form a delimiter is a monomorphic mark to divide a linear data chunk.

They can be made of one constant value or a sequence of multiple constant values. There can also be different marks indicating the beginning and ending points of a specific data subfield and/or type. To achieve the desired result in this essence, single value monomorphic marks are often preferable because they occupy lesser space. Almost every programmer once or twice dug into Ascii table to find a suitable delimiter character for strings. But there are drawbacks of this approach in certain cases. Specially when the data is input by user or another program which is not controllable, and if the programmer forgets to filter the input, the delimiter can be introduced as a part of data, and that may cause errors.

The term delimiter refers to a separating character. In the following text, semicolons are used as delimiters between the numbers:

123;234;123;3454353;3453;

Delimiters are commonly used in computer files to separate data values. For example, the comma-separated values (CSV) file format uses a comma as the delimiter between fields, and a newline character as the delimiter between records.

One of the most interesting problems with using delimiters is the fact that often, data might use the character chosen as a delimiter. Consider a spreadsheet with the following values:

Fred Laura Fred, Laura

When saved to a CSV, the resulting file would include the line:

Fred,Laura,Fred,Laura

If you reopened the CSV file in the spreadsheet there would be four columns instead of the desired three.

Fred Laura Fred Laura

Confusing data values with delimiters is quite a problem, with numerous solutions. One of the most common is escape characters.

Another common use of delimiters is to denote versions of computer programs. For example, software version 1.7.1 would denote the first major build of the program, with the seventh major software patch, and the first minor bugfix of that patch.

For word delimiters used in written languages, see interword separation.

de:Delimiter pl:Delimiter