Add prefix, suffix or numbers to lines
Add text before or after every line, number lines, wrap them in quotes, or join them into one line.
Runs in your browser. Your input is not uploaded.
Loading the tool…
What it does
These are the small edits you would otherwise do with a multi-cursor or a regex: add text to the start or end of every line, number the lines, wrap each one in quotes, or join them into one line.
A common use is turning a column of IDs into an SQL IN (...) list: wrap in single quotes and join with , .
How to use it
- Paste one item per line.
- Set a prefix, suffix, quotes or numbering.
- Choose Join with to put everything on one line, then copy.
Example: Quote and join for SQL
Input
a1 b2 c3
Output
'a1', 'b2', 'c3'
Things to watch for
- Quotes are added as-is. If a line already contains the quote character, escape it first with the string escape tool.
- Numbering counts lines after blank lines are removed, if that option is on.
Questions
- How do I add a comma to the end of each line?
- Put
,in Suffix. To put everything on one line instead, leave Suffix empty and choose Join with comma. - How do I number lines?
- Tick Number lines and choose the start number and the separator, such as
.or a tab. - Can I reverse the line order?
- Yes, tick Reverse. It is applied before numbering.
- Does it change Windows line endings?
- Input CRLF is read as a new line. Output uses LF. Use the line endings tool if you need CRLF back.