CSV sort, filter and dedupe

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

Input

The CSV to process.
Column separator. "auto" detects it from the first line.
Column name to sort by. Numbers sort numerically.
Sort from largest to smallest.
Keep only rows where some cell contains this text (case-insensitive).
Column names to keep, in this order. All columns when omitted.
Remove rows that are exact duplicates of an earlier row.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/csv-sort-filter-dedupe \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"name,age\nSam,31\nAlex,27\nSam,31","sort_by":"age","dedupe":true}}'
import json, urllib.request

body = {'input': {'text': 'name,age\nSam,31\nAlex,27\nSam,31', 'sort_by': 'age', 'dedupe': True}}
request = urllib.request.Request("https://setget.net/v1/tools/csv-sort-filter-dedupe", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/csv-sort-filter-dedupe", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"name,age\nSam,31\nAlex,27\nSam,31","sort_by":"age","dedupe":true}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "csv-sort-filter-dedupe",
  "input": {
    "text": "name,age\nSam,31\nAlex,27\nSam,31",
    "sort_by": "age",
    "dedupe": true
  }
}
{
  "input": {
    "text": "name,age\nSam,31\nAlex,27\nSam,31",
    "sort_by": "age",
    "dedupe": true
  }
}

Endpoint: POST /v1/tools/csv-sort-filter-dedupe. Over MCP: run_tool with slug: "csv-sort-filter-dedupe". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

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

Example

Input
{
  "text": "name,age\nSam,31\nAlex,27\nSam,31",
  "sort_by": "age",
  "dedupe": true
}
Result
{
  "text": "name,age\nAlex,27\nSam,31\n",
  "rows": 2,
  "removed": 1
}