Skip to content
OddsockLocal
Local
Source text
ItemQuantity
Notebook12
Pencil4
3 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the CSV into Source text.
  2. Type a header in Sort column, or leave it blank to sort the first column.
  3. Type text in Row contains to keep rows that include it in any cell. Leave it blank to keep all rows.
  4. Set Order to ascending or descending.
  5. Copy the CSV.

What is Sort and filter a CSV?

A dump sorted by the first column, with every row still in it, is rarely the file you wanted to hand someone. Sort and filter a CSV orders one column and drops rows that do not contain your text. The match looks in every cell, ignoring letter case. Sort uses numeric order when the cells are numbers, so 4 comes before 12. A plain text sort would put 12 first because the character 1 precedes 4.

Read more

Leave Sort column blank to order the first header. Leave Row contains blank to keep every row. Order is ascending unless you switch it. The result is CSV in the new order, with the header on top. Filtering happens before the sort, so the order you see is the order of the rows that matched.

Use cases

  • A buyer sorts Quantity ascending so the smallest stock, Pen at 4, sits above Notebook at 12.
  • A support inbox pasted into a sheet is filtered to rows that contain one ticket id.
  • A teacher sorts Item descending to show Pen above Notebook without rewriting the file.
  • A catalog pass keeps only rows that contain the word blue, then sorts those rows by SKU.
  • Someone checking a joined sheet filters to a single name before exporting the slice.

Quantity from small to large

Item,Quantity / Notebook,12 / Pen,4. Set Sort column to Quantity and Order to ascending. Row contains stays empty.

Quantity ascending returns Item,Quantity / Pen,4 / Notebook,12, because 4 is smaller than 12. Filtering with Row contains set to Pen returns Item,Quantity / Pen,4. Sorting the sample by Item descending returns Pen,4 and then Notebook,12.

Why use Oddsock

Numeric sort plus a contains-filter writes a new CSV in the order you asked for, which a grid sort on screen does not save until you export.

Related tools

Using this tool

The comparison is numeric. Twelve is larger than four, so ascending order puts Pen,4 above Notebook,12. A character-by-character sort would have done the opposite.