Skip to content
AZ Tools

CSV Column Extractor

Paste CSV/TSV, click the columns you want, get them back as plain lines, CSV, quoted-comma-separated, or a ready-made SQL IN-clause.

Output · Rows: 3
ana@x.com
bae@y.com
cai@z.com

Parsing is RFC 4180 — quoted fields can contain delimiters and newlines, doubled quotes decode to a single quote.

How to use

  1. Paste your CSV/TSV and confirm the header toggle matches your data.
  2. Click the column chips to choose which to keep — order in the output follows the column order.
  3. Pick the output format (plain, CSV, quoted list, SQL IN) and copy.

About this tool

Show

A focused cut from a wide CSV without opening a spreadsheet. Parses RFC 4180–style CSV (quoted fields with embedded delimiters and escaped quotes), with selectable tab/semicolon/pipe delimiters. Pick columns by header name or index, optionally dedupe and sort, and emit them in the format that matches the next step — newline-per-row for piping into another tool, or a (...) IN-clause to drop into a SQL editor.

Proper quote handling is the reason to use a parser rather than splitting on commas, and it is exactly where a quick script goes wrong. A quoted field may contain the delimiter, a newline, or a doubled quote standing for a literal one, so a line in the file is not necessarily a row in the data. Splitting on commas turns one address field into three columns and silently shifts every column after it, which produces output that looks plausible and is wrong.

Selecting by header name is safer than by index whenever the source might change, since an inserted column shifts every index after it but leaves the names alone. Names have to match the header exactly, which makes a trailing space or an invisible byte-order mark at the start of the file a common reason a column appears missing.

The SQL output is a convenience for pasting into a query, not a way to build queries from untrusted input. It quotes and escapes the values it emits, but a list assembled by string concatenation is the wrong shape for anything that reaches a database on a user's behalf; use bound parameters there. Long lists also run into per-statement limits in most engines, which is worth knowing before pasting fifty thousand identifiers.

Everything runs in the browser on text you paste, so the practical ceiling is your tab's memory rather than a file size limit. Very large exports are better handled by a streaming tool.

Frequently asked questions

Does it handle quoted fields and escaped quotes?

Yes. Fields wrapped in double quotes are unquoted, embedded delimiters and newlines are preserved, and "" is treated as a literal double quote per RFC 4180.

Why is there a SQL IN-clause option?

When you've got a list of IDs in a CSV and you need to write WHERE id IN (...), this saves you the manual quoting. The format escapes single quotes too.

The IN-clause quotes numbers. Is that a problem?

It can be. Quoting a numeric literal asks the database to compare a string with a number, and engines disagree about what happens next: some convert silently, some raise an error, and some stop using the index on that column, which turns a fast lookup into a full scan. Check the column's type and drop the quotes when it is numeric.

Why does dedupe return fewer rows than I expected?

Values are compared exactly, so whitespace, letter case and invisible characters all count. Two entries that look identical but differ by a trailing space stay separate — which is common in data pasted out of a spreadsheet or a web page. Trim the source column before extracting when the input came from either.

Related tools