Whitespace-Separated Values
container.array.whitespace_separatedList separated by spaces or tabs: value1 value2 value3. Example: "one two three" or "1 2 3 4 5".
Worked samples
DuckDB 1.5.5 · finetype 0.6.64
| Value | As VARCHAR | parts |
|---|---|---|
| apple banana cherry | apple banana cherry | ['apple banana cherry'] |
| 1 2 3 4 5 | 1 2 3 4 5 | ['1 2 3 4 5'] |
| red green blue | red green blue | ['red\tgreen\tblue'] |
Shape
^[^\s]+(\s+[^\s]+)*$| Value | Length | Shape |
|---|---|---|
| apple banana cherry | 19 | matches |
| 1 2 3 4 5 | 9 | matches |
| red green blue | 14 | matches |
Told apart
3 of the 3 other array types accept every one of these samples on shape alone.
- Comma-Separated Values (Simple)matches them by pattern
- Pipe-Separated Valuesmatches them by pattern
- Semicolon-Separated Valuesmatches them by pattern
Going the other way, this type's own rule accepts 3 of 3 samples of Comma-Separated Values (Simple), 2 of 2 samples of Pipe-Separated Values and 2 of 2 samples of Semicolon-Separated Values.
Background
Origin
FineType defines container.array.whitespace_separated itself, as a list separated by spaces or tabs, such as one two three or 1 2 3 4 5.[1] FineType's label definition notes that the whitespace separator is common in plain-text logs and Unix tools.[1]
POSIX awk gives the FS variable a default value of a single space.[2] When FS is a single space, POSIX awk skips leading and trailing blank and newline characters and delimits fields by sets of one or more blank or newline characters.[2]
XML Schema Part 2: Datatypes Second Edition was published as a W3C Recommendation on 28 October 2004.[3] XML Schema Part 2 defines the lexical space of a list datatype as a space-separated sequence of literals of the item type.[3] The HTML Standard defines a set of space-separated tokens as a string of zero or more tokens separated by one or more ASCII whitespace.[4] The HTML Standard allows a string holding a set of space-separated tokens to have leading or trailing ASCII whitespace.[4] The WHATWG Infra Standard defines ASCII whitespace as U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE.[5] The HTML Standard requires the class attribute, when specified, to have a value that is a set of space-separated tokens.[6]
Use
The HTML Standard distinguishes an unordered set of unique space-separated tokens from an ordered set of unique space-separated tokens, in which the order of the tokens is meaningful.[4] XML Schema Part 2 gives the example of a list of strings whose three lines of text form a list of length 18, not 3, because list items are separated at space boundaries.[3]
Python's str.split, called with no separator, treats runs of consecutive whitespace as a single separator and returns no empty strings at the start or end for leading or trailing whitespace.[7] Python's documentation shows ' 1 2 3 '.split() returning ['1', '2', '3'].[7]
Sources
- [1]definitions_container.yamlFineType
- [2]awkstandard
- [3]XML Schema Part 2: Datatypes Second Editionstandard
- [4]HTML Standardstandard
- [5]Infra Standardstandard
- [6]HTML Standardstandard
- [7]Built-in Types — Python 3.15.0 documentationdocumentation
Detection notes
v1 migration: New for v2. Whitespace separator common in plain-text logs and Unix tools. Regex split on whitespace.
Use it
$ finetype infer -i "apple banana cherry" --mode column
→ container.array.whitespace_separated
SELECT ft_infer('apple banana cherry');
-- → 'container.array.whitespace_separated'CAST({col} AS VARCHAR)Schema
https://meridian.online/schemas/container.array.whitespace_separated · Frictionless type string
finetype taxonomy container.array.whitespace_separated -o json-schema