Skip to main content

CSV Column Selector

Choose the useful columns from a CSV file, remove the others, and get a table containing only the data you need.

  • Clipboard

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Names or numbers separated by commas, in the desired order

Was this tool useful?

How does this tool work?

An export often contains more fields than the file you need to deliver: technical identifiers, private contact details, history or columns intended for a different team. CSV column selection creates a copy containing only the required fields in the order you specify. Choose columns by heading or position, then retrieve a CSV ready for import. The operation reduces the number of columns while retaining the records and their values. Removing fields does not, by itself, guarantee that the information you keep has been anonymised.

The reader detects commas, semicolons, tabs or vertical bars from the first logical record, ignoring separators inside quoted fields. Quoted fields may contain line breaks and doubled quotation marks. The detected delimiter is reused for output. The header option starts enabled and determines whether names can be resolved and how data rows are counted. Turn it off for a file without headings: its first record then remains data and columns must be selected by number.

Enter a comma-separated list in the selection field. Positions start at 1, so 3,1 keeps the third column followed by the first. A name must match its header cell exactly, including capitals, accents and any spaces. Surrounding spaces are stripped from each selection item; for a source heading with spaces around it, use its position or rename the heading first. An empty selection or an unknown column produces an error instead of being silently skipped.

Each record is reconstructed using the requested columns. A missing field in a short record becomes an empty cell without shifting subsequent values. Selecting a column repeatedly repeats it in the output; that may be intentional but adds no new information. If several headings share a name, name lookup selects the first occurrence, while positions can select the others. A heading made entirely of digits is interpreted as a position. A heading containing a comma cannot be entered as one name in this comma-separated list.

How to use this tool

  1. Supply the table and identify its headings

    Paste or import the CSV or TSV. Set the header option according to the actual first record, then locate the positions of the fields you want to keep.

  2. Describe the required projection

    Enter exact names or positions starting at 1, separated by commas. Arrange the list in the final column order. Fields omitted from the list will not be included in the export.

  3. Check headings and record counts

    Run the selection, inspect the first record and a few short rows, then copy or export the result. The data-record count should remain unchanged after accounting for the header.

Use cases

Prepare a file for a supplier

Retain only the product references and quantities needed by a contractor, then check that the remaining cells do not themselves contain unnecessary personal information.

Meet a positional import schema

Place fields in the sequence required by an older application that maps values by their column position rather than matching the names in its header record.

Reduce a working table

Extract a few dimensions from a wide export before comparison or manual inspection while keeping every record and the original order of those records.

Examples

Deliver only an identifier and quantity

The customer column is absent from the new file. Both product references remain aligned with their quantities. No record is removed and quantities are not added together. The original input remains available for another selection.

Input

id;customer;quantity
P12;Alice;4
P18;Nora;2
Selection: id,quantity; header enabled

Result

id;quantity
P12;4
P18;2

Reorder a file without headings

The third value moves before the first in every record. P12 is not mistaken for a heading: disabling the header option ensures that the first product remains part of the data output.

Input

P12;Alice;4
P18;Nora;2
Selection: 3,1; header disabled

Result

4;P12
2;P18

Tips and best practices

  • Use positions for repeated headings, headings consisting only of digits, or headings containing commas. This avoids ambiguities in the field that accepts a list of names.
  • Column removal and row filtering serve different purposes. If you need to remove records according to a condition, apply a CSV filter to the relevant field instead of changing the selection list.
  • A retained comment or identifier may still contain sensitive information. Inspect actual values before sharing the output; local execution does not automatically remove information from the columns you keep.

Frequently asked questions

Can I change column order without changing record order?

Yes. The order of the selection list controls the output columns while records retain their input order. Selecting 2,1 swaps the first two columns without sorting any of their values.

How do I choose the second column with an identical heading?

Enter its position starting at 1. Looking up a name selects the first matching occurrence and cannot distinguish identical headings; the numerical position identifies the precise column you need.

What happens to a field missing from a short record?

It becomes an empty string in the selected output position. Other fields remain associated with their original positions. Validate the CSV first if uneven record lengths should be reported as data-quality problems.

Why does entering the heading 2026 not choose my column?

An entry made only of digits is treated as a column position, in this case position 2026. Enter the actual position of that column or rename its heading before selecting it by name.

Related tools

Tools similar or complementary to this one.

Similar tools

Rename one or more CSV columns without changing the row data.

Data & spreadsheetsUse this tool

Filter CSV rows by column using text, exact values, or numeric conditions.

Data & spreadsheetsUse this tool

Validate CSV structure and quickly identify problematic rows or columns in your data.

Data & spreadsheetsFeaturedUse this tool
GuideBest practicesBeginner

Split a CSV or Excel table into smaller files

Discover when to split a large table by row count or by a column value, and how to preserve a useful structure in every output file.

29 August 20261 min