Column Select By Indices

Select and reorder zero-based columns from a rectangular CSV, allowing repeated selections while requiring at least one output column.

Description

Selecting CSV columns can also reorder or repeat them.

Selecting CSV columns can also reorder or repeat them. Zero-based indices make the requested projection explicit for every record.1

Select and reorder zero-based columns from a rectangular CSV, allowing repeated selections while requiring at least one output column.

When to use Column Select By Indices

Use this for the following task: Select and reorder zero-based columns from a rectangular CSV, allowing repeated selections while requiring at least one output column.

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 Column Select By Indices and understand its results

  1. Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
  2. Enter csv, delimiter, indices using the field table, then run the tool.
  3. Read csv. Interpret flags, units, ordering and placeholder values using the rules below.
  4. Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
Input fieldMeaningValue type and boundsRequirement
csvCSV textstring; maximum text length 100000Required
delimiterDelimiterstring; choose ",", ";", "\t"Required
indicesIndiceslist of integer; minimum entries 1; maximum entries 10000; each entry: integer; minimum 0Required

Parse rectangular records and require at least one in-range column index. Apply indices in supplied order to every row, including any header; repeated indices repeat cells. Enforce output field/text budgets.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.

The shared writer doubles interior quotes and quotes cells when needed for delimiters or line breaks, including a single empty-field record. It normally emits LF record endings without a terminal newline; any tool-specific quote-all behavior is stated above.

outputRow = indices.map(i => decodedRow[i])

This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.

Output fieldMeaningValue type
csvCSV textstring
json
{
  "input": {
    "csv": "id,name,age\n1,Ada,36",
    "delimiter": ",",
    "indices": [
      1,
      0
    ]
  },
  "output": {
    "csv": "name,id\nAda,1"
  }
}

Limitations and assumptions

No header is inferred or skipped. This does not infer a schema or alter cell values.

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 Fill Missing Cells Default Value for this operation: Pad short CSV records to an explicit width with a default string, preserving present empty fields and rejecting longer records; output materialization is bounded.

Further background: Format and language reference: Column Select By Indices.

References

  1. Format and language reference: Column Select By Indices — RFC Editor

  2. Column Select By Indices — 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.

  • Fill Missing Cells Default Value

    Pad short CSV records to an explicit width with a default string, preserving present empty fields and rejecting longer records; output materialization is bounded.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies