Data · 25 tools · nothing uploads

Sort and filter CSV rows

Sort a CSV by one column, as text or as numbers, ascending or descending, and keep only rows matching a 'col op value' filter (=, !=, >, <, >=, <=, contains, startsWith). Runs entirely on your device.

Input

Options

live

Sort and filter CSV rows applies where first, one col op value test using =, !=, >, <, >=, <=, contains or startsWith. It then sorts by sortBy as text, or as numbers with numeric on. A comparison against a non-numeric cell is refused rather than coerced. Only one filter condition runs per pass, so two conditions need two runs.

Questions

What operators does where support?

=, !=, >, <, >=, <=, contains and startsWith, written as "column op value".

What happens with a comparison against a non-numeric cell?

The tool refuses, naming which cell or value can not be read as a number.

Can I filter and sort by different columns at once?

Yes, where runs first, then sortBy sorts whatever rows are left.

What does numeric do?

It switches the sort comparison from text order to numeric order for the sortBy column.

Can I combine two filter conditions?

Not in one pass; the where field takes exactly one column op value expression, so a second condition needs a second run.

What does the summary line report?

How many rows went in, how many came out, and which filter and sort were applied.

Related Data tools

1→1Reorder / insert CSV columnsReorder (and drop) a CSV's columns by name, and optionally insert one new column with a constant value at a given position. Quote-aware. A record with a quoted field containing a literal newline stays one record.Takes one file1→1Map CSV column namesRename a CSV's header to a new schema ("old=new" pairs), and optionally drop every column that isn't named in the mapping. Column order and data are otherwise untouched. Quote-aware. A record with a quoted field containing a literal newline stays one record.Takes one file1→1Change CSV separatorRe-delimit a CSV (comma, semicolon, tab or pipe), auto-detecting the current separator when not told what it is. Quote-aware. A record with a quoted field containing a literal newline (including in the header) stays one record.Takes one file1→1Transpose CSVSwap a CSV's rows and columns. Column 1 becomes row 1, and so on. A ragged row (fewer cells than the widest row) is padded with empty cells rather than refused. Quote-aware. A record with a quoted field containing a literal newline stays one record, not two.Takes one file1→1Split CSV into partsCut a CSV into several smaller files of N data rows each, repeating the header in every part. Quote-aware: a record with a quoted field containing a literal newline stays one record.Takes one filen→1Merge CSV filesConcatenate several CSVs with the same header into one file, in the order given. Quote-aware. A record with a quoted field containing a literal newline stays one record.Combines the files you drop1→1Remove duplicate CSV rowsStrip repeated rows from a CSV. Compares whole records, not physical lines, so a quoted field containing a newline is one record and stays one record.Takes one file1→1Find incomplete CSV recordsReport every record whose cell count doesn't match the header: too few cells (a truncated record) or too many (an unescaped comma). Read-only: nothing is changed. Quote-aware, so a record with a quoted field containing a literal newline still counts as one record with the right cell count.Takes one file