Prefix, suffix, join

Add text to the start and end of every line

Wrap every line of a list in the same text: quotes and a comma for a database query, a bullet for a document, a web address for a list of page names, or HTML tags for a menu. Type what goes before and after, and every line gets it. Blank lines are left alone unless you say otherwise, and you can join the result into a single line with any separator.

Your lines

0 lines
Tidy spaces and blank lines
Remove duplicates
Sort
Add text to each line
Split, join and line endings
Lines out0 lines in
0
Removedblank and duplicate lines
0

Three common jobs

A list of values for a query or a CSV row

Say you have three order numbers on separate lines and need them inside an SQL IN (…) clause. Put a single quote at the start and end, and type ", " in "Join all lines with". The three lines become:

'1042', '1077', '1090'

Paste that between the brackets. Leave "Join" empty and use a suffix of "'," instead if you want one value per line with trailing commas.

Bullets for a document or chat message

A prefix of "• " (bullet and space) turns a plain list into bullet points. Blank lines stay blank by default, so groups stay separated:

• Milk
• Bread

• Eggs

Full web addresses from page names

A prefix of a site's address turns page names into links you can check:

https://example.nz/about
https://example.nz/contact
https://example.nz/privacy-policy

Escaping pitfalls

Wrapping is plain text substitution: the cleaner doesn't know about SQL, CSV or HTML rules. If a value already contains the character you're wrapping with, the result can break. A name like O'Brien wrapped in single quotes gives 'O'Brien', which ends the quote early in SQL; databases expect the inner quote doubled. In CSV, values containing commas or double quotes need double quotes around them, and inner double quotes doubled. In HTML, an ampersand or angle bracket inside a value should be escaped. For anything going into a live database, use your database tool's own parameters rather than pasted values.

More ideas

A prefix of "<li>" and a suffix of "</li>" turns lines into HTML list items. A prefix of "#" turns words into hashtags. A suffix of ";" closes lines of code or configuration. A prefix of "- [ ] " makes a task list for apps that understand that format, and a prefix of "> " quotes each line in an email reply.

Other things to know

  • Spaces count. If you want a space between a bullet and the text, include it in the prefix. Trailing spaces on your lines will sit inside the suffix, so turn on trimming if needed.
  • Blank lines. Tick "Add it to blank lines too" if every line, even empty ones, needs the wrapper.
  • Order of steps. Prefixes and suffixes are added after trimming, blank-line removal, duplicate removal and sorting, so sorting isn't affected by what you add.
  • Tabs as separators. Type \t in "Join all lines with" to join with tabs, which pastes neatly into spreadsheet columns.

Your text and the prefix and suffix you type stay in your browser and are never put in the page address. Pair this with removing duplicate lines for clean lists of IDs, or use the full text cleaner.

Questions people ask

How do I make a comma-separated list on one line?

Type ", " (comma and space) in "Join all lines with". Add quotes as a prefix and suffix if each value needs them.

Does the tool escape quotes inside my values?

No. It adds exactly the text you type. Check values that contain quotes, commas or ampersands, and escape them for the format you're using.

Last reviewed: