# CSV sort, filter and dedupe

Sort CSV by a column, keep rows containing some text, pick columns and remove duplicate rows.

- Endpoint: `POST https://setget.net/v1/tools/csv-sort-filter-dedupe` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `csv-sort-filter-dedupe`
- Page: https://setget.net/tools/csv-sort-filter-dedupe

## Inputs

- `text` (required, string): The CSV to process.
- `delimiter` (optional, string, one of `auto`, `comma`, `tab`, `semicolon`, `pipe`, default `"auto"`): Column separator. "auto" detects it from the first line.
- `sort_by` (optional, string): Column name to sort by. Numbers sort numerically.
- `descending` (optional, boolean, default `false`): Sort from largest to smallest.
- `contains` (optional, string): Keep only rows where some cell contains this text (case-insensitive).
- `columns` (optional, array): Column names to keep, in this order. All columns when omitted.
- `dedupe` (optional, boolean, default `false`): Remove rows that are exact duplicates of an earlier row.

## Example

```json
{"input":{"text":"name,age\nSam,31\nAlex,27\nSam,31","sort_by":"age","dedupe":true}}
```

Result:

```json
{"text":"name,age\nAlex,27\nSam,31\n","rows":2,"removed":1}
```
