tsvkit.org
TSV Toolkit
Sample data Say hi →

Extract TSV Columns

keep and reorder columns · by name or 1-indexed position

Keep only the columns you name — and get them in the order you name them, which makes this a reorder tool as well as a subset tool. Listing 3,1 gives you the third column followed by the first. That's the quickest way to move a column to the front, which nothing else on the site does directly.

extract
Drop a .tsv file here, or
ready

How to use

  1. Paste or drop the file.
  2. List the columns you want, comma-separated, by header name or 1-indexed position — email,name or 2,1,5.
  3. Order matters: the output follows the order you typed, not the original.
  4. Copy or download.

Extract, or delete?

Two ways to the same result: name the columns to keep here, or name the ones to remove with delete columns. Extract when you want a handful out of many, delete when you want to drop a handful. The other difference matters for repeatability: extract also pins the output order and fails loudly if a named column is missing, while delete tolerates a column that isn't there. For a file whose shape you don't fully trust, extract is the stricter choice.

Duplicating a column

Naming the same column twice gives you it twice — occasionally useful when a consumer wants the same value in two positions, or when you want to keep an original alongside a version you're about to modify with find and replace. The two copies get the same header name, which some name-indexed readers won't like; rename one with header tools.

FAQ

What if a column name I typed doesn't exist?

You get an error naming it, rather than a silently smaller file. Check the exact spelling — a trailing space in the header is the usual culprit, and header tools will trim it.

Can I use a range like 2-5?

No — list them individually: 2,3,4,5. Ranges would be ambiguous with header names that contain a hyphen.

Does it work on a file with no header?

Yes, using 1-indexed positions. The first row is treated as data and carried through in whatever order you specify.

What's the shell equivalent?

cut -f2,1 -d$'\t' — except cut ignores the order you write and always outputs ascending fields, which is exactly the limitation this page doesn't have.

Privacy

100% client-side. No upload. See the privacy policy.