Text Column Extractor

Paste lines of delimited text, say which columns you want, such as 2 or 1,3-5, and press Extract columns. Columns come out in the order you list them, joined with the delimiter you choose.

Try an example

About this text column extractor

Data copied from spreadsheets, CSV exports, server logs, and command-line output usually comes as lines of values separated by a delimiter. This tool splits every line on the delimiter you choose and keeps only the columns you ask for. Columns are numbered from 1, and you can list them in any order, repeat them, or give ranges, so 3,1 swaps two columns and 2-4 keeps the middle three. The Spaces option treats any run of spaces as one separator, which suits aligned text and logs. Lines that are too short can be skipped or padded. Commas inside quoted CSV fields are treated as separators, so for complex CSV use the CSV to JSON converter.

How to extract columns from text

  1. Paste your data. Paste lines of text with one record per line, or press an example.
  2. Set the delimiters and columns. Choose how the columns are separated, type the columns you want such as 1,3-5, and pick the delimiter for the result.
  3. Press Extract columns. Check the color-coded preview, then copy the result or download it as a text file.

Frequently asked questions

How do I select several columns?

Separate column numbers with commas and use a hyphen for ranges. 1,3-5,7 extracts columns 1, 3, 4, 5, and 7, in that order.

Can I change the order of columns?

Yes. Columns are written in the order you list them, so typing 3,1 puts the third column first. You can also list a column twice.

What does the Spaces delimiter do?

It treats one or more spaces or tabs as a single separator and ignores spaces at the start of a line. This works well for log files and text aligned in columns.

What happens to lines with fewer columns?

By default they are skipped and counted under Lines skipped. You can instead keep them with an empty value or N/A in place of the missing column.

Does it handle quoted CSV values with commas inside?

No, every comma is treated as a separator. For CSV files where values contain commas inside quotes, convert the file with a CSV parser first.