# Remove duplicate lines

Remove repeated lines from text, keeping the first occurrence of each and the original order.

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

## Inputs

- `text` (required, string): The lines to clean up.
- `case_sensitive` (optional, boolean, default `true`): Treat upper and lower case as different lines.
- `trim` (optional, boolean, default `false`): Ignore spaces at the start and end of lines when comparing.
- `keep_blank` (optional, boolean, default `false`): Keep every blank line instead of treating blank lines as duplicates.

## Example 1

```json
{"input":{"text":"a\nb\na\nc\nb"}}
```

Result:

```json
{"text":"a\nb\nc","lines":3,"removed":2}
```

## Example 2: Ignoring case and stray spaces

```json
{"input":{"text":"Sam\nsam \nAlex","case_sensitive":false,"trim":true}}
```

Result:

```json
{"text":"Sam\nAlex","lines":2,"removed":1}
```

**Do the lines need to be sorted first?** No. Duplicates are found anywhere in the text, and the remaining lines keep their order.

**Which copy is kept?** The first one, exactly as it was written.
