# Wrap Lines in Quotes

Wrap each line of text in quotes or brackets with an optional trailing comma — build SQL IN lists, JSON arrays, and CSV rows fast. Free, private, runs in your browser.

## Run it

- **CLI:** `gizza tool wrap-lines-in-quotes "Paste values, one per line…"`
- **Web:** https://gizza.ai/tools/wrap-lines-in-quotes/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/wrap-lines-in-quotes/tool.json

## Inputs

- `text` — Text (one value per line) _(field)_
- `wrap` — Wrap style _(field)_
- `open` — Custom opening delimiter _(field)_
- `close` — Custom closing delimiter _(field)_
- `separator` — Trailing separator _(field)_
- `last_line_separator` — Separator after the last line too _(field)_
- `skip_empty` — Skip blank lines _(field)_
- `trim` — Trim whitespace on each line _(field)_
- `escape` — Escape the delimiter inside lines _(field)_

## Output

- Wrapped text (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `text` — Text (one value per line)
- `wrap` — Wrap style
- `open` — Custom opening delimiter
- `close` — Custom closing delimiter
- `separator` — Trailing separator
- `last_line_separator` — Separator after the last line too
- `skip_empty` — Skip blank lines
- `trim` — Trim whitespace on each line
- `escape` — Escape the delimiter inside lines

Example: `https://gizza.ai/tools/wrap-lines-in-quotes/?text=Paste%20values%2C%20one%20per%20line%E2%80%A6&wrap=double&open=only%20used%20when%20Wrap%20style%20%3D%20Custom&close=empty%20%3D%20mirror%20the%20opening%20delimiter&separator=%2C%20for%20a%20SQL%20IN%20list%20%2F%20JSON%20array&last_line_separator=true&skip_empty=true&trim=true&escape=true`

---

## About this tool

**Wrap Lines in Quotes** puts your chosen quotes or brackets around every line
of text and, optionally, adds a trailing separator — so a pasted column of
values becomes a ready-to-use SQL `IN (…)` list, JSON array, or CSV row. It all
runs **locally in your browser** via WebAssembly; nothing is uploaded.

- **Wrap style** — pick double `"…"`, single `'…'`, backticks `` `…` ``,
  parentheses `(…)`, square `[…]`, curly `{…}`, angle `<…>`, or guillemets
  `«…»`. Choose **Custom** to type your own opening/closing delimiters (leave
  the closing one empty to mirror the opening one).
- **Trailing separator** — appended after each wrapped line. Type `,` to build a
  comma-separated list. By default the **last** line omits it, so the result is a
  valid `IN (…)` / array body; tick *Separator after the last line too* to keep it.
- **Skip blank lines** — on by default: blank / whitespace-only lines pass
  through unchanged (not wrapped, no separator).
- **Trim whitespace** — strips leading/trailing spaces on each line before wrapping.
- **Escape the delimiter inside lines** — backslash-escapes the quote (and any
  `\`) that already appears in a line, so a value like `5" pipe` becomes a valid
  `"5\" pipe"` instead of breaking your string.

### Worked example

Paste three values, choose **single quotes**, and set the separator to `,`:

```
apple
banana
cherry
```

You get a drop-in SQL `IN` list body:

```
'apple',
'banana',
'cherry'
```

Wrap the same lines in **square brackets** with no separator and each becomes
`[apple]`, `[banana]`, `[cherry]`.

### Handy for

- Building `WHERE col IN ('a','b','c')` clauses from a spreadsheet column.
- Turning a list into a JSON/Python array of strings.
- Quoting shell arguments or config values line by line.

## FAQ

<details>
<summary>How do I make a SQL IN list or a JSON array?</summary>

Paste one value per line, pick your quote style (single quotes for SQL, double
for JSON), and set the **Trailing separator** to `,`. Every line is quoted and
comma-separated, and the **last** line drops the trailing comma by default, so
you can paste the result straight inside `IN ( … )` or `[ … ]` without a syntax
error. Wrap the whole block in parentheses or brackets yourself.

</details>

<details>
<summary>What happens to blank lines?</summary>

With **Skip blank lines** on (the default), any empty or whitespace-only line is
left exactly as it was — it isn't quoted and doesn't receive a separator, so the
surrounding lines still form a clean list. Turn the option off to wrap every
line, including blank ones (a blank line then becomes an empty pair like `""` or
`[]`). The result also reports how many of the total lines were wrapped.

</details>

<details>
<summary>My values contain quotes — won't that break the output?</summary>

Enable **Escape the delimiter inside lines**. It backslash-escapes any
occurrence of the delimiter — and any literal backslash — inside each line
before wrapping, so `5" pipe` becomes `"5\" pipe"` and `a\b` becomes `"a\\b"`.
That keeps double-quoted JSON/SQL string literals valid. Without it, inner
quotes are left as-is (useful when you know they're already safe).

</details>

<details>
<summary>Can I use my own brackets or a multi-character wrapper?</summary>

Yes. Set **Wrap style** to **Custom** and type the opening delimiter (e.g.
`<!--`) and closing delimiter (e.g. `-->`). If you leave the closing field
empty, it mirrors the opening one, so typing `|` wraps each line as `|value|`.
Multi-character delimiters like `<<` / `>>` work too.

</details>

## Limits & notes

- Lines are split on newlines only; the tool never re-wraps or reflows long
  lines. A trailing newline in the input does not create an extra empty line.
- **Escape** covers only the delimiter characters and backslashes — it is not a
  full JSON/CSV encoder (it won't escape tabs or control characters).
- Everything is processed in-browser; large pastes are limited only by your
  device's memory.

## Related tools

- [Extract Action Items from Meeting Notes](https://gizza.ai/tools/action-item-extractor/): Extract action items, owners, and decisions from meeting notes or daily notes with deterministic rules. Markdown checklist or JSON, private in-browser.
- [Add Line Numbers](https://gizza.ai/tools/add-line-numbers/): Add line numbers to every line of text online, like nl or cat -n — custom start, step, separator, and alignment. Free and private, runs in your browser.
- [ANSI Log Renderer](https://gizza.ai/tools/ansi-log-renderer/): Paste ANSI-colored terminal output or CI logs and render them as HTML, or strip escape codes to plain text. Handles 16-color, 256-color, and truecolor SGR codes.
- [Rust AST Diff](https://gizza.ai/tools/ast-diff/): Compare two Rust source snippets structurally. The tool parses both files, canonicalizes their ASTs, and ignores formatting, whitespace, and comments.
- [Bulk Artifact Extractor](https://gizza.ai/tools/bulk-artifact-extractor/): Scan pasted text for emails, URLs, IPs, domains, phones, Bitcoin addresses, and Luhn-valid card numbers with offsets and context.
