Hongmu Notes

CSV comma separated sort

Paste the comma-separated content in, sort it into columns, and then paste it back.
100% Browser local processing 0 Data upload

🔀 Sort settings

💡 Instructions for use

  • Column numbers are counted from left to right in the data, and the first column is one, which is consistent with the column order in the spreadsheet software.
  • Text comparison is arranged in character order, and Chinese is in encoding order, so it is more suitable for names and numbers; numerical comparison will be parsed into numbers first and then compared.
  • After setting the second sort key, rows with the same value in the first column will be sorted according to the rules of the second column, and the result will be more in line with daily habits.
  • When the header is fixed, the first row does not participate in sorting and the position remains unchanged; if the first row is data, please switch this option to Unfixed.
  • The sorting is a stable sorting, and rows with identical values maintain their original order without disturbing their relative positions.
  • The data is only processed in the browser and is not uploaded or saved; if you need to keep the file, please copy or download the results.

Paste the comma-separated content in, sort it into columns, and then paste it back.

separation method

Change the column separation method to commas to be consistent with the file format.

If you use the wrong delimiter, the entire row will be treated as one column, and sorting will naturally not work.

Quotation mark processing

Commas within fields are usually enclosed in quotation marks and cannot be mistaken for column boundaries.

Sorting only adjusts the row order, leaving quotes and spaces intact.

Content source

Copy the contents directly from the spreadsheet software after saving as a comma-delimited file.

You can also paste from the data export results.

Difference from tab character

Comma delimited is used for CSV files, tabs are used for spreadsheet software copying.

If the two formats are selected incorrectly, the number of recognized columns will be displayed as one.

Result check

First check whether the number of identified columns is consistent with expectations, and then perform sorting.

After sorting, spot check two rows to confirm that the fields are not serialized.

First confirm that the column number is correctly identified before sorting; if the column number is displayed as one, it is probably because the separation method is wrong.

📖 Glossary

sort key
The column according to which the sorting is based can be a single column or a combination of multiple columns arranged according to priority.
Ascending and descending order
Ascending order is from small to large or forward in character order, while descending order is the opposite. The results of the two directions for the same set of data are completely reversed.
stable sorting
Rows with the same sort key value maintain their original order and will not be swapped due to sorting.
numerical comparison
First parse the cell content into numbers and then compare the sizes to avoid misordering when comparing by characters.
text comparison
Compare one by one in character encoding order. Chinese characters are usually arranged in encoding order, which is suitable for names and numbers.
multi-level sorting
Sort by the first column first, then sort by the second column if the values are the same, and so on to form a hierarchical order.
Header
The field names in the first row of the table should be fixed in the first row when sorting to avoid being treated as data for comparison.
Group sorting
First sort by a certain column within the group, and then decide the order of the groups. It is often used to organize lists by department or region.
Null value handling
The arrangement position of the cell when it is empty. When comparing numerical values, space-time values ​​are usually sorted at the end, making it easier to see valuable data first.
delimiter
Characters used to separate columns, tabs used for content copied by spreadsheet software, and commas used for comma-delimited files.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

What should I do if the number of columns is displayed as one?
Change the column separation method to commas.
Will the commas in the fields be misplaced?
Commas enclosed in quotation marks do not count as the same field.