Non-Empty Count Per Column
Count data cells that are not exactly empty per CSV column, excluding an explicit header; whitespace-only strings count as present.
Description
An exactly empty CSV cell differs from one containing whitespace.
An exactly empty CSV cell differs from one containing whitespace. Counting stored presence requires an explicit emptiness rule.1
Count data cells that are not exactly empty per CSV column, excluding an explicit header; whitespace-only strings count as present.
When to use Non-Empty Count Per Column
Use this for the following task: Count data cells that are not exactly empty per CSV column, excluding an explicit header; whitespace-only strings count as present.
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 Non-Empty Count Per Column 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 columns. 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 an explicit header and count present cells by zero-based column.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.
count[column] = data cells whose decoded string != empty string This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.
| Output field | Meaning | Value type |
|---|---|---|
| columns | Columns | list of record: column (integer), count (integer) |
{
"input": {
"csv": "a,b\nx,\n ,y",
"delimiter": ",",
"hasHeader": true
},
"output": {
"columns": [
{
"column": 0,
"count": 2
},
{
"column": 1,
"count": 1
}
]
}
} Limitations and assumptions
Whitespace-only values count as present. No trimming or missing-token vocabulary is applied.
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 Field Whitespace Trimmer for this operation: Trim ECMAScript boundary whitespace from every decoded CSV cell and re-encode with minimal quoting and LF record endings; interior whitespace is preserved.
Further background: Format and language reference: Non-Empty Count Per Column.
References
-
Format and language reference: Non-Empty Count Per Column — RFC Editor
-
Non-Empty Count Per Column — 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.
- Field Whitespace Trimmer
Trim ECMAScript boundary whitespace from every decoded CSV cell and re-encode with minimal quoting and LF record endings; interior whitespace is preserved.