Extract columns from a CSV

Select named or indexed CSV columns and write them as a smaller, valid CSV file.

freeworks offlinenothing uploaded
ToolCSV Column Extractor
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Rows are parsed with the chosen delimiter, requested names or zero-based indexes are selected, and fields containing delimiters, quotes, or newlines are escaped on output. Header retention is independent of the selected data columns.

  • Column zero is a useful starting selection.
  • Keeping headers preserves labels for a second import.

Worked example

Extract name and email from employee data
Pull the name and email columns from a 3-row employee CSV
Input
											name,email,department,salary
Alice,[email protected],Engineering,95000
Bob,[email protected],Marketing,82000
Carol,[email protected],Engineering,98000
										
Output
												name
Alice
Bob
Carol
											

When to use this

Reporting pipelines narrow wide exports, privacy shares remove fields, and fixture files keep only needed columns.

Edge cases

  • A quoted comma remains inside one selected value.
  • A missing column name produces no selected field instead of shifting indexes.
  • A quoted newline is re-escaped so it remains one output record.

References