CSV Sorter
Sort CSV rows by a text, number, or date column
CSV Sorter — what it does
Sort rows by any column, telling the tool whether to treat the values as text, numbers or dates, and in ascending or descending order. Declaring the type is what separates a correct sort from the classic spreadsheet failure where 100 lands between 10 and 11 because the column was compared as text.
When this tool helps
- Ordering a transaction export by date before splitting it into periods or deduplicating by latest record.
- Ranking products, campaigns or regions by a numeric measure to find the top and bottom performers.
- Alphabetising a name or reference list before printing or handing it over.
How to use it
- Choose the CSV file.
- Select the sort column and its data type.
- Choose ascending or descending order.
- Process and download the sorted CSV.
Accuracy, limits, and good practice
- Choosing number on a column containing text places non-numeric values inconsistently — profile the column first if you are unsure it is clean.
- Date sorting depends on parseable dates; run the date normaliser first when the column mixes several formats.
- Sorting rewrites row order permanently in the output, so keep the original if the source sequence carries meaning.
Frequently asked questions
Can I sort by two columns?
Sort by the secondary column first, then by the primary one. A stable sort preserves the earlier order within equal values.
Where do blank values go?
They group together at one end of the order. Clean or filter them first if their position matters for a report.
Is text sorting case-sensitive?
Text comparison follows standard string ordering, so mixed capitalisation can group unexpectedly. Normalise case first for a strict alphabetical list.
Related tools on this site
- JSON to Excel — Turn JSON arrays into an XLSX worksheet with optional flattening
- CSV Group & Aggregate — Group rows and calculate sum, average, count, min, or max
- Excel Column Extractor — Select specific worksheet columns and export a smaller Excel workbook
Everything above runs inside this page. CSV Sorter needs no account, no upload, and no server round trip — close the tab and nothing is left behind.
CSV 排序工具能做什麼
依任一欄位排序資料列,並指定該欄要當作文字、數字或日期比較,同時選擇遞增或遞減。有沒有宣告型別,正是正確排序與經典試算表災難的分野——後者會因為以文字比較,把 100 排在 10 與 11 之間。
什麼時候用得上
- 在依期間拆分或保留最新紀錄之前,先把交易匯出檔依日期排序。
- 依數值指標為產品、活動或地區排名,找出表現最好與最差者。
- 列印或交付前,先把名單或參考清單依字母順序排好。
使用步驟
- 選擇 CSV 檔案。
- 選定排序欄位與其資料型別。
- 選擇遞增或遞減。
- 執行處理並下載排序後的 CSV。
精確度、限制與實務建議
- 對含文字的欄位選「數字」會讓非數值資料的位置變得不一致;不確定欄位是否乾淨時請先做欄位統計。
- 日期排序需要可解析的日期,欄位混雜多種格式時請先用日期格式統一工具處理。
- 排序會永久改寫輸出的列順序,若原始順序本身具有意義,請保留原始檔。
常見問題
可以用兩個欄位排序嗎?
先依次要欄位排序,再依主要欄位排序。穩定排序會在相同值中保留前一次的順序。
空白值會排到哪裡?
會集中在順序的一端。若其位置會影響報表,請先清理或篩除。
文字排序區分大小寫嗎?
文字比較採標準字串順序,因此大小寫混雜時可能分群異常。需要嚴格字母序請先統一大小寫。
本站相關工具
- JSON 轉 Excel — 將 JSON 陣列轉為 XLSX,並可攤平巢狀資料
- CSV 分組彙總 — 依欄位分組並計算加總、平均、計數、最小或最大值
- Excel 欄位提取器 — 選擇指定工作表欄位並匯出較小的 Excel 活頁簿
以上步驟全部在這個頁面內完成,CSV 排序工具 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。