How to Add Text to Each Line
To add text to each line, paste the lines and type what you want in front of them in Start of line. The text is added to every line at once. This is the Example list with the default start text, a dash and a space:
apple - apple
banana - banana
(blank line) (blank line)
cherry - cherryPut text in End of line to add something after each line, for example a semicolon or a comma. You can fill in both boxes. Add text to the beginning and the end of each line in one pass, such as a quote before and after, or a tag before and after.
Add Quotes, Brackets or HTML Tags to Each Line
Wrap line in puts the same characters around each line, before the start and end text is added. With single quotes and a comma at the end of the line, the Example list becomes a ready list of quoted items:
'apple',
'banana',
'cherry',A quote that is already inside a line is doubled, as SQL and CSV do, so it's becomes 'it''s'. This is not the backslash escaping that JSON and most programming languages use. Round, square and curly brackets are added as they are.
The li, p and td choices wrap each line in an HTML tag. In that case the characters &, < and > inside the line are replaced with their HTML codes, so the result is valid HTML. The li choice gives you:
<li>apple</li>
<li>banana</li>
<li>cherry</li>If you want the whole list on one line instead, with commas between the items, use Column to Comma Separated List, which also adds brackets for SQL.
Number the Lines with {n}
Anywhere in the start or end text, {n} is replaced with the number of the line, counting from 1. With the start text {n}. the Example list becomes:
1. apple
2. banana
3. cherryBlank lines are not counted while they are left alone. If you set Blank lines to Add text too, they are numbered like any other line. You can use {n} in both boxes, and with other text, for example Step {n}: .
Remove a Prefix or Suffix from Each Line
Set Action to Remove text. The tool takes the start text off every line that begins with it and the end text off every line that finishes with it. Lines that do not have the text are left as they are, and the match is case sensitive. With the start text - :
- apple
- banana
- cherry
ā apple
banana
cherryIn this mode {n} and Wrap line in are not used. The characters you type are matched exactly as written. To take quotes off a list, enter the quote character in both Start of line and End of line.
Blank Lines and Spaces
- Blank lines: Leave as they are is the default, so empty lines stay empty and do not get a lone dash or comma. Add text too puts the text on them. Delete them removes them from the result.
- A line that has only spaces counts as blank.
- Trim spaces first removes spaces at the start and end of each line before the text is added. Without it, the spaces stay and your text goes before them.
- A trailing line break at the end of the list counts as one blank line.
If the lines need to be sorted first, use Sort Lines. To remove repeated lines before you add text, see Remove Duplicate Lines.
Adding Text in Notepad++ and Other Editors
Code editors can do this with a regular expression. In Notepad++, open Find and Replace, set the search mode to Regular expression, search for ^ and replace it with your text to add it at the start of every line. Searching for $ adds text at the end. In an editor without regular expressions, or in a word processor, it is easier to paste the lines here and paste the result back.
Text you add is inserted exactly as typed. Characters such as $, ^ and \ have no special meaning in this tool. The start and end text can each be up to 200 characters long.
Limits and Privacy
- The start and end text have to fit on one line, because they are typed in a single-line box. Use Wrap line in for tags.
- The tool adds text to whole lines only. It cannot add text inside a line or after a certain word.
- Input is limited to 2,000,000 characters.
Your lines are processed by code running in your browser. They are not sent to a server and not stored. See the Privacy Policy for details.