CSV Column Reorder
Change CSV column order before downloading
Enter header names separated by commas.
CSV Column Reorder — what it does
Type the header names in the order you want them and the tool rebuilds the CSV with columns arranged exactly that way. Because most import routines match on position rather than on name, reordering is often the difference between a file that loads cleanly and one that lands every value in the wrong field.
Worked example
A staff export rearranged for a payroll template that wants department first and has no use for email or start dates. The order box, pre-filled with the current headers, was replaced with department, name, salary.
Input — contacts.csv (order box: department, name, salary)
name,email,department,start_date,salary Ann Lee,ann.lee@example.com,Sales,2021-03-15,52000 Ben Ortiz,ben.ortiz@example.com,Engineering,2019-11-02,88000 Chloe Park,chloe.park@example.com,Sales,2023-06-01,47500 Dev Patel,dev.patel@example.com,Support,2020-01-20,41000 Emma Rossi,emma.rossi@example.com,Engineering,2022-09-12,91000
Output — contacts-reordered.csv
department,name,salary Sales,Ann Lee,52000 Engineering,Ben Ortiz,88000 Sales,Chloe Park,47500 Support,Dev Patel,41000 Engineering,Emma Rossi,91000
Names are matched case-sensitively: a second run with department, Name stopped with the message "Check the column names." and produced no file. The download starts with a UTF-8 byte-order mark.
When this tool helps
- Rearranging an export to match the strict column sequence a bank, payroll or logistics upload expects.
- Moving identifiers and dates to the front so a wide table is readable without scrolling sideways.
- Aligning two files that hold the same fields in a different order before appending them together.
How to use it
- Choose the CSV file.
- Enter the header names separated by commas, in the target order.
- Process the file.
- Download the reordered CSV.
Accuracy, limits, and good practice
- Names must match the existing headers exactly; a typo will either drop that column or fail to place it where you expect.
- Any column you leave out of the list is dropped, so this doubles as a quick way to select and order in one step.
- Reordering never touches values, so a mis-ordered result can simply be run again with a corrected list.
Frequently asked questions
What happens to columns I do not list?
They are not included in the output. List every header you want to keep, in the sequence you want them.
Does row order change?
No. Rows stay in their original sequence. Use the CSV sorter if you need to reorder rows as well.
Can I use this to duplicate a column?
Listing the same header twice is not a supported way to copy a field; use a spreadsheet formula for that.
Are spaces around the commas a problem?
No. Spaces on either side of each comma are trimmed, so department,name and department, name behave the same. Spaces inside a header still have to match exactly.
Can I list a header that contains a comma?
No. The order box is split on commas, so a header such as "Last, First" is read as two names and the run fails with the column-name message. Rename that header first with the column renamer.
Related tools on this site
- TSV & CSV Converter — Convert tab-separated data and CSV text in either direction
- CSV File Difference — Compare two CSV files by a key column and export differences
- CSV Sorter — Sort CSV rows by a text, number, or date column
Further reading: Cleaning a CSV export before you import it anywhere · CSV, JSON, YAML, XML and Markdown Tables: When Each Fits and How to Convert
Everything above runs inside this page. CSV Column Reorder needs no account, no upload, and no server round trip — close the tab and nothing is left behind.
CSV 欄位重新排序能做什麼
依你想要的順序輸入標題名稱,工具就會照著重組 CSV 欄位。由於多數匯入程式是依位置而非名稱對應欄位,重新排序往往決定了檔案是順利載入,還是每個值都跑到錯誤欄位。
實際範例
員工名單依薪資範本的要求重排:department 放最前面,email 與 start_date 不需要。順序欄位原本自動填好現有欄名,改成 department, name, salary。
來源:contacts.csv(順序欄位填 department, name, salary)
name,email,department,start_date,salary Ann Lee,ann.lee@example.com,Sales,2021-03-15,52000 Ben Ortiz,ben.ortiz@example.com,Engineering,2019-11-02,88000 Chloe Park,chloe.park@example.com,Sales,2023-06-01,47500 Dev Patel,dev.patel@example.com,Support,2020-01-20,41000 Emma Rossi,emma.rossi@example.com,Engineering,2022-09-12,91000
得到:contacts-reordered.csv
department,name,salary Sales,Ann Lee,52000 Engineering,Ben Ortiz,88000 Sales,Chloe Park,47500 Support,Dev Patel,41000 Engineering,Emma Rossi,91000
欄名比對區分大小寫:再跑一次改填 department, Name 時,狀態列顯示「Check the column names.」而且不產生檔案。下載檔開頭帶 UTF-8 BOM。
什麼時候用得上
- 把匯出檔調整成銀行、薪資或物流上傳所要求的固定欄位順序。
- 把識別碼與日期移到前面,讓寬表格不必左右捲動就能閱讀。
- 在合併兩份欄位相同但順序不同的檔案前,先把順序對齊。
使用步驟
- 選擇 CSV 檔案。
- 以逗號分隔,依目標順序輸入標題名稱。
- 執行處理。
- 下載重新排序後的 CSV。
精確度、限制與實務建議
- 名稱必須與現有標題完全相符;打錯字會讓該欄被丟掉,或無法排到你預期的位置。
- 沒列進清單的欄位會被移除,因此這個工具也能一次完成「挑選 + 排序」。
- 重新排序不會動到任何值,順序排錯時只要用正確清單重跑一次即可。
常見問題
沒列出的欄位會怎樣?
不會出現在輸出中。請把所有要保留的標題都依順序列出。
資料列順序會變嗎?
不會,列的順序維持原狀。需要排序列請使用 CSV 排序工具。
可以用它複製欄位嗎?
重複列出同一個標題並非受支援的複製方式,需要複製欄位請用試算表公式處理。
逗號前後的空格有影響嗎?
沒有。每個逗號兩側的空格會被去掉,department,name 與 department, name 效力相同;但欄名內部的空格仍須完全一致。
欄名本身含逗號可以列進去嗎?
不行。順序欄位是以逗號切開的,像「Last, First」會被當成兩個名稱,執行會以欄名錯誤的訊息中止。請先以欄位改名工具把那個欄名改掉。
本站相關工具
- TSV 與 CSV 互轉 — 在 Tab 分隔資料與 CSV 文字之間轉換
- CSV 檔案差異比較 — 依鍵值欄位比較兩個 CSV 並匯出差異
- CSV 排序工具 — 依文字、數字或日期欄位排序 CSV 資料
延伸閱讀: 匯入之前先把 CSV 匯出檔清乾淨 · CSV、JSON、YAML、XML 與 Markdown 表格:各自適用的場合與轉換方法
以上步驟全部在這個頁面內完成,CSV 欄位重新排序 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。