Constant Column Detector
Identify columns with one exact decoded value across all data records, excluding an explicit header; empty strings may be constant but zero observations are not evidence.
Description
A constant column has the same stored value in every observed data record.
A constant column has the same stored value in every observed data record. That value can be empty without making the column unobserved.1
Identify columns with one exact decoded value across all data records, excluding an explicit header; empty strings may be constant but zero observations are not evidence.
When to use Constant Column Detector
Use this for the following task: Identify columns with one exact decoded value across all data records, excluding an explicit header; empty strings may be constant but zero observations are not evidence.
Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
How to use Constant Column Detector and understand its results
- Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
- Enter csv, delimiter, hasHeader using the field table, then run the tool.
- Read constants. Interpret flags, units, ordering and placeholder values using the rules below.
- Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| csv | CSV text | string; maximum text length 100000 | Required |
| delimiter | Delimiter | string; choose ",", ";", "\t" | Required |
| hasHeader | Has header | boolean | Required |
Parse rectangular records, exclude the explicit header and compare exact decoded strings by zero-based column. Return the shared values for constant columns.2
Parse delimiters only outside quoted fields and decode doubled quotes. A quoted line break stays inside its cell; malformed quoting is returned as an input error.
constant when data exists AND every cell equals the first data value This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.
| Output field | Meaning | Value type |
|---|---|---|
| constants | Constants | list of record: column (integer), value (string) |
{
"input": {
"csv": "id,country,blank\n1,UK,\n2,UK,",
"delimiter": ",",
"hasHeader": true
},
"output": {
"constants": [
{
"column": 1,
"value": "UK"
},
{
"column": 2,
"value": ""
}
]
}
} Limitations and assumptions
A single data row makes every column constant. Header-only data yields no evidence, and whitespace/case are significant.
Where CSV is parsed, the shared parser accepts comma, semicolon or tab separators, doubled quotes and quoted line breaks, with CR/LF/CRLF record endings. Blank records remain records. CSV inputs are bounded to 100000 UTF-16 units and 10000 fields. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.
Alternative or Complementary methods
Choose Drop Empty Columns Detector for this operation: Identify zero-based columns whose every data cell is exactly empty, excluding an explicit header; no columns are inferred empty when there are no data records. For a complementary task, use Low-Cardinality Category Lister for this operation: List first-encounter distinct nonempty values for data columns whose observed category count is at most an explicit maximum, excluding an explicit header.
Further background: Format and language reference: Constant Column Detector.
References
-
Format and language reference: Constant Column Detector — RFC Editor
-
Constant Column Detector — tool.io
Similar or alternative tools
- Drop Empty Columns Detector
Identify zero-based columns whose every data cell is exactly empty, excluding an explicit header; no columns are inferred empty when there are no data records.
- Low-Cardinality Category Lister
List first-encounter distinct nonempty values for data columns whose observed category count is at most an explicit maximum, excluding an explicit header.