How to Rename and Reorder CSV Columns Before an Import
Rename headers, reorder columns, and drop the ones you do not need before a CRM, ecommerce, or database import — without opening a spreadsheet.
A CRM import fails because the destination expects email and the export gave you email_address. An ecommerce platform wants columns in a specific order. A database migration only needs six of the twenty columns in the dump. Header names, column order, and which fields are present are part of the import contract, so fixing those structural differences before import avoids changing the cell values themselves.
The column mapper keeps the values exactly as the source CSV contains them and only changes three things: which columns are included, what they are called, and the order they appear in. The downloaded CSV contains only the included columns in the chosen order, while the original file remains untouched.
Nablyx processes one CSV locally in your browser without uploading it, up to 200 MB, and writes mapped.csv as UTF-8, comma-delimited CSV. It does not repair ragged rows or change cell contents, so rows must match the source header width before mapping; the first-party cap and streaming evidence is recorded in docs/tool-audit/batch-a.md.
A realistic starting point
A typical CRM export looks like this. The headers are descriptive, the delimiter is comma, and the data is fine — the only problem is the contract with the receiving system.
crm-import.csv
Suppose the target CRM wants id, name, email, plan, in that order, and does not care about company_name. The mapper handles all three changes in one pass: rename customer_id to id, rename email_address to email, drop company_name, and put subscription_plan before full_name in the output. The values inside the cells are untouched.
What the tool actually does
Three controls, one output. Each source column appears as a row with its source name, an Output name field, a Use option, and up/down arrows.
- 01
Drop the CSV in
Pick or drop the file. The first rows are inspected to learn the headers; nothing is uploaded. The current size limit is 200 MB per file.
- 02
Rename any column
Type the new header in the Output name field next to the source name. The Output name is trimmed of surrounding whitespace before it is written.
- 03
Drop columns you do not need
Turn Use off to remove a column from the output. At least one column must remain included, every included column needs a non-empty Output name, and output names must be unique across included columns.
- 04
Reorder with the arrows
Use the up and down buttons to swap a column with its neighbour. The new order shows up in the preview and is what the exported file uses.
- 05
Download the mapped CSV
The output is written as a UTF-8, comma-delimited file named mapped.csv. The preview shows the first 8 rows of the mapped result; the full file is generated when you click Download.
Decide the output column names from the receiving system's documentation, not from the source CSV. The mapper does not know what the destination expects, and a renamed header that does not match the importer's contract is the same problem you started with.
When the mapper is the right tool, and when it is not
The mapper is a structural transformation. It does not touch cell contents, so it is safe to run last in a pipeline.
| Task | Right tool |
|---|---|
| Rename headers, reorder columns, drop columns before an import | csv-column-mapper |
| Fix stray blank rows, rows with different numbers of columns, or unclosed quotes | clean-csv |
| Repair UTF-8 / Windows-1252 mojibake or wrong delimiter | fix-csv-encoding |
| Merge two CSVs by a shared key column | join-csv |
| Compare the same dataset from two exports | compare-csv |
| Stop Excel from reformatting zeros, formulas, or dates on open | excel-safe-csv |
When the source also needs repair, a practical sequence is clean → fix encoding → map → import. The mapper can run after repair because it changes column selection, names, and order without reformatting cell values.
Common pitfalls before the rename
Three things look like "the mapper is broken" but are actually the mapper refusing to guess.
The mapper rejects an empty output name and rejects two included columns that share the same output name. Both checks happen when you start the download, so the error message tells you which column needs a unique, non-empty name.
Duplicate output names. Renaming email_address to email while leaving email as email is a silent error until the destination refuses to import. Pick distinct output names; the mapper enforces uniqueness across included columns.
Empty output names. Clearing the Output name field still leaves that column included unless Use is turned off. Turning Use off is the cleaner way to drop a column than blanking its name.
Column count vs. row width. If the source CSV has rows with different numbers of columns, the mapper stops when a row does not match the header count. Run the file through the CSV cleaner first.
Verifying the mapped file before you import
The preview shows the first 8 rows of the mapped result with the new headers and new order, recomputed on every keystroke. That is enough to catch most wiring mistakes, but two checks catch the rest.
Confirm the column count. Open the downloaded file in a text editor and confirm the header has the number of fields you expect, separated by commas. A header that lost a column shows up immediately because the preview header row and the file header row disagree.
Confirm one row per data line. A trailing comma, an extra blank line, or a quoted newline inside a cell all change the row count in the destination. Quoted fields may contain embedded newlines, so a physical line count (wc -l) need not equal the CSV row count even for valid input — the mapper parses logical rows, not physical lines. Compare the CSV row count (the number of records the source contained, which the preview or the source tool reports) against the mapped file: when the source header count and every data row's field count agree, the mapper preserves the source row count exactly.
U.S. destination schema example
If a source file has customer_id,email_address,invoice_total,invoice_date with values such as 00125,avery@example.com,1234.50,12/31/2026, a destination might require id,email,amount,date in that order. The mapper can rename and reorder those columns while preserving 00125, 1234.50, and 12/31/2026 exactly; converting the date to ISO would be a separate value transformation.
See the transformation
Awkward source headers become import-ready columns.
Rename the columns you need while keeping every value under the correct header.
cust_idcustomer_idgiven_namefirst_namemailemail✓ Values stay with the right column
Need to do this now?
Rename and reorder your CSVRelated tools
Open the tool this guide is about, or explore a related one.
- Clean and fix CSV files — no uploadRepair common CSV problems including wrong delimiters, uneven rows, empty lines, whitespace, BOM markers, and duplicate headers.
- Compare CSV files online freeCompare two CSV files and review added, removed, and changed rows directly in your browser.
- Join CSV files online freeJoin two CSV files on matching key columns, choose inner, left, or full results, and control duplicate lookup keys without uploading your data.