Extract columns from a CSV file
Keep only the columns you need, such as names and phone numbers.
- Nothing is uploaded
- Free
- No sign-up
Guide
Extract Columns: the complete guide
Last updated 3 min read
About this tool
PrivateCSV extracts the columns you choose from a CSV file and saves them as a new CSV, for example only the names and phone numbers of a contact export. Tick the columns in the order you want them, optionally skip rows where they are empty and remove duplicate rows, and download the result. Values are copied as text, so leading zeros and long numbers are unchanged. The file is processed in your browser and never uploaded.
How to extract columns from a CSV file
- Choose the CSV file. Its columns are listed by header name.
- Tick the columns to keep. They are written in the order you tick them, so tick phone before name to put phone numbers first.
- Choose whether to skip rows where the chosen columns are all empty, and whether to remove duplicate rows.
- Click Extract columns and download the new CSV file.
Example
Keeping only the name and phone columns of a contact export.
id,name,email,phone,city
1,Ana Silva,ana@example.com,555-0101,Lisbon
2,Ben Carter,ben@example.com,,Boston
3,Chloé Martin,chloe@example.com,555-0103,Lyonname,phone
Ana Silva,555-0101
Ben Carter,
Chloé Martin,555-0103When you need it
- Names and phone numbers from a contact export
- Phone, CRM and email exports hold dozens of columns. Keep only the name and phone number columns to import them into another app, a dialer or an SMS tool.
- A clean list of unique emails or IDs
- Tick a single column and remove duplicate rows to get each value once, such as every customer email address in an order export, ready to paste or import.
- Sharing less data
- Before sending a file to a colleague or a supplier, keep only the columns they need and leave out personal or internal data. Since the file is not uploaded, the full version never leaves your device either.
How the extraction works
- The header row is read to list the columns. Without a header, columns are listed as Column 1, Column 2 and so on, with a sample value from the first row.
- The file is read in chunks rather than loaded whole, and the result is built as it goes.
- Values are copied exactly as text: 00123 stays 00123 and quoted values with commas or line breaks stay intact.
- The result keeps the delimiter of the original file, such as a semicolon.
- A row that has fewer cells than the header gets empty values for the missing columns.
Skipping empty rows and removing duplicates
“Skip rows where the chosen columns are empty” drops a row only when every extracted cell is empty or blank; a contact with a name but no phone number is kept. “Remove duplicate rows” compares the extracted values only, not the whole original row, and keeps the first occurrence. Both are counted in the result so you know how many rows were left out.
Limits to know about
- It selects columns, not rows by value: it cannot keep only the rows where a city is Lisbon.
- Duplicates are found by exact text, so “Ana@example.com” and “ana@example.com” are two different values.
- Removing duplicates keeps every unique row in memory, so on very large files with millions of unique rows it needs a computer rather than a phone.
- Columns are copied as they are; they cannot be renamed, split or combined here.
Frequently asked questions
How do I extract specific columns from a CSV file?
Choose the file, tick the columns you want in the order you want them, and click Extract columns. You download a new CSV file with only those columns, header included.
How do I extract phone numbers and names from a CSV file?
Tick the name column, then the phone column, and leave “Skip rows where the chosen columns are empty” ticked. The result has two columns, and phone numbers are copied as text, so a leading 0 or + is kept.
How do I extract columns from a CSV file in Python?
With pandas: pd.read_csv("file.csv", usecols=["name", "phone"], dtype=str), then .to_csv("out.csv", index=False). usecols keeps the file's column order whatever order you list them in; select df[["phone", "name"]] to reorder. dtype=str keeps leading zeros.
Can I extract columns in Excel instead?
Yes: open the file, delete the columns you do not need and save as CSV. Opening a CSV by double-clicking it can change values on the way, though, such as removing leading zeros or rounding IDs longer than 15 digits. This tool copies every value as text.
How do I get the unique values of one column?
Tick only that column and tick “Remove duplicate rows”. Each value appears once, in the order it first appears in the file.
Related tools
Go further
Your files never leave your device
PrivateCSV runs every tool inside your browser. No upload, no account, nothing to install.