Bulk-edit every line
Add the same text before and after each line of a list. Common recipes:
| Goal | Prefix | Suffix |
|---|---|---|
| Quoted, comma-separated values | " |
", |
| HTML list items | <li> |
</li> |
| Markdown bullets | - |
|
| SQL values | (' |
'), |
| Hashtags | # |
|
| Numbered labels | Item {n}: |
{n} is replaced by a counter that starts wherever you set it, so “Q{n}. ” produces Q1., Q2., Q3. With Skip blank lines on, empty lines are left alone and don’t use up a number.
For plain line numbers with padding and formats, use Add or Remove Line Numbers; to join the result into one line, pass it to List to Comma Separated.
Worked example: a SQL IN list
Start with a column of IDs copied from a spreadsheet. Set the prefix to ' and the suffix to ',, then send the result to List to Comma Separated with “Nothing” as the joiner (or simply delete the final comma) and wrap it in IN ( … ). For values that may contain quotes themselves, escape them first with the String Escaper’s SQL mode.
Worked example
Here is what the Add Prefix & Suffix to Lines returns for its built-in example. Settings used: Skip blank lines: on. Click Try an example in the tool above to load it, then change it as you like.
apple
banana
cherry"apple",
"banana",
"cherry",Questions
How do I add quotes around each line?
Set the prefix to " and the suffix to ", (or just " for no comma).
Can I add incrementing numbers?
Yes. Put {n} anywhere in the prefix or suffix; it becomes 1, 2, 3… or whatever start value you choose.
Last reviewed · How Textkiln tools work