Extract one or more columns from CSV or tab-separated text

Paste rows of delimited text, type the column number you want, and the tool returns just that column, or several columns, for every row.

Live demo · real result from this tool
Counted from 1. Several: 1,3 or a range 2-4.

Result

emailasha@example.comsam@example.com

Processed on your device — nothing is uploaded.

How to use the column extractor

  1. Paste your rows into Delimited lines (CSV, TSV …).
  2. Type the column in Column(s): one number like 2, a list like 1,3, or a range like 2-4.
  3. Choose the Delimiter: comma, tab, semicolon, pipe, spaces or Custom… (then fill in Custom delimiter).
  4. Keep Respect “quoted, fields” ticked for real CSV files. Tick Skip the first line to drop a header.
  5. Copy the result.

What it does and when to use it

Exports from shops, mailing tools, banks and databases often hold far more columns than you need. Opening a spreadsheet just to copy one column is slow, and for text from a log or a terminal it may not be possible at all. This tool works straight on the text.

Typical jobs:

  • Pull the email column from a sign-up export, then clean it with remove duplicates.
  • Take the prices out of a tab-separated report and add them up with the number extractor.
  • Keep only name and city from a contact list by typing 1,3.

For a spreadsheet-style view of a whole CSV file, the CSV column extractor in the data tools may suit you better. This tool is aimed at quick copy-and-paste work.

How it works

The tool reads the text line by line and skips blank lines. If Skip the first line is ticked, it drops the first line before anything else. Each remaining line is split at the delimiter. With quotes respected, a field that starts with a double quote runs to the closing quote, so "Lee, Sam" stays one field, and a doubled quote "" inside it becomes one quote. The Spaces option treats a run of spaces as one break, which suits aligned columns. The requested columns are picked out and joined with the input delimiter. When several columns are joined and quotes are respected, a value that holds the delimiter or a quote is wrapped in quotes again, CSV style. Everything runs in your browser.

Worked examples

These outputs come from the tool’s own function.

One CSV column. From a three-row list of names, emails and cities, column 2 gives email, asha@example.com and sam@example.com. The comma inside "Lee, Sam" did not shift the columns.

A range from tab-separated data. With rows id name qty price, 1 pen 4 1.20 and 2 ink 1 6.00 separated by tabs, Column(s) 2-4 and Tab gives the name, quantity and price, for example pen 4 1.20, still tab-separated.

Reordered columns and a short row. Rows a,b,c, 1,2,3, a blank line and 4,5, with Column(s) 3,1, give c,a, 3,1 and ,4. Column 3 came first, the blank line was skipped, and the missing third value in 4,5 came out empty.

Limits and tips

  • Quotes are added back only when several columns are joined: Lee, Sam taken with another column comes out as "Lee, Sam",Leeds, which stays valid CSV. A single column comes out as plain values without quotes.
  • A column number larger than any row gives empty lines.
  • Quotes are only special at the start of a field.

Frequently asked questions

How are columns numbered?
From 1, counting from the left. Column 1 is the first field on each line. Typing 0 gives an error message.
Can I get several columns at once?
Yes. Type a list such as 1,3 or a range such as 2-4. The columns come out in the order you type them, so 3,1 puts column 3 first. They are joined with the same delimiter as the input.
What if a row is shorter than the others?
Missing columns come out empty, so every input row still gives one output row. Blank lines are skipped.
How do I keep the header row out of the result?
Tick "Skip the first line". The first line is dropped before the columns are taken.
Does it work with data copied from Excel or Google Sheets?
Yes. Cells copied from a spreadsheet are separated by tabs, so choose Tab as the delimiter.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close