BLOG / GUIDE · 2026-04-08 · 7 min

How to add a suffix or comma to every line

Five ways to put a string at the end of every line — Excel concatenation, Notepad++ regex, VS Code multi-cursor, sed/awk, or an instant browser tool. SQL terminators, CSV rows, HTML <br>, status marks.

The short answer. Paste your lines into the add-suffix tool, type the suffix (; for SQL, , for CSV rows, <br> for HTML), copy the result. In Excel, =A1 & ";" filled down. In Notepad++ with regex on, replace $ with your suffix. In VS Code, Ctrl+ACtrl+Shift+LEnd → type. On the command line, sed 's/$/;/' file.txt or awk '{print $0 ";"}' file.txt.

What "add a suffix" actually means

"Put this text at the end of every line" sounds trivial, but the use cases vary enough that the tool choice matters:

  • SQL statement termination. Adding ; to every line of a paste so each is a complete statement.
  • CSV row builder. Adding , or ,END to mark the end of each row when constructing CSV by hand.
  • HTML <br> tags. Turning a plain-text list into HTML where each line is its own visual row.
  • Quoted-string preparation. Adding " after every line so each becomes a fragment of a quoted string (usually combined with a prefix step).
  • Status marking. Appending , [DONE], or a date stamp to every entry in a checklist.

Same caveat as the prefix case: "every line" sometimes means "every non-blank line". A blank line + a suffix gives you a line of just the suffix — rarely useful. The tools below either default to skipping blanks or have a flag to do so.

How do you add a suffix in the browser, instantly?

Open the add-suffix tool. Paste your list. Type any string in the suffix box. The output updates live; copy when done.

  • Any literal string works: ; for SQL, , for CSV, for a list, <br> for HTML, 2026 for a date stamp. Leading space included if you type it.
  • Blank lines stay blank by default. The Skip blanks toggle is on, so empty rows aren't suffixed. Turn it off if you want every row touched.
  • Order preserved. The output keeps your original line sequence exactly.
  • Nothing uploads. One map() call in the browser. Open DevTools → Network — zero outbound requests after page load.

How do you add a suffix in Notepad++ or VS Code?

The mirror image of the prefix case — the start-of-line anchor ^ becomes the end-of-line anchor $.

Notepad++ — Find & Replace with regex

  1. Press Ctrl+H.
  2. Set Search Mode to Regular expression.
  3. In Find what: $ (matches the end of every line).
  4. In Replace with: your suffix.
  5. Click Replace All.

To skip blank lines, search for (?<!^)$ — "end of line that wasn't immediately preceded by start of line" — or simpler, .+$ with &your-suffix as the replacement.

VS Code — multi-cursor

  1. Select all lines (Ctrl+A).
  2. Press Ctrl+Shift+L (Windows / Linux) or Cmd+Shift+L (macOS). This places a cursor at the start of every selected line.
  3. Press End to snap all cursors to the line's end, then type the suffix. Every line gets it simultaneously.

Or use Find & Replace with regex: Ctrl+H.* icon → search $ → replace with suffix.

How do you add a suffix in Excel?

The classic concatenation, mirror of the prefix recipe:

=A1 & ";"

Put it in B1, fill down. For a JSON-friendly quoted value with a trailing comma:

="""" & A1 & """,

For a CSV row builder where every cell becomes one row of comma-separated content:

=A1 & "," & B1 & "," & C1

Or in modern Excel, =TEXTJOIN(",", FALSE, A1:C1) — cleaner and resilient to empty cells. Google Sheets uses identical syntax for all three.

How do you add a suffix on the command line?

Two short recipes.

sed with end-of-line anchor:

sed 's/$/;/' file.txt

Adds ; to the end of every line. Add -i on GNU sed (Linux) or -i '' on macOS sed to edit in place. To skip blank lines:

sed '/^$/!s/$/;/' file.txt

awk for clean concatenation:

awk '{print $0 ";"}' file.txt

To skip blanks:

awk 'NF { print $0 ";"; next } { print }' file.txt

On Windows in PowerShell:

Get-Content file.txt | ForEach-Object { $_ + ";" } | Set-Content out.txt

A note on Microsoft Word

Word doesn't have a clean way to add text at the end of every line without converting to plain text first. The Find & Replace approach — replacing ^p with ;^p — puts the suffix before the paragraph mark, which is correct, but works only for paragraph endings. If your document mixes paragraph marks and Shift-Enter line breaks, you'll have to handle both. For anything more than a quick fix, copy the lines into a plain-text tool or the browser tool and paste the result back.

Which method should you use?

Where the lines already areFastest method
One-off list from anywhereBrowser tool
Excel column with related data=A1 & ";" filled down
Open in VS CodeMulti-cursor → End → type suffix
Open in Notepad++Regex Find & Replace, $ → suffix
A file on disk, scriptedsed 's/$/;/' file.txt
Need to skip blank linesBrowser tool (default) or sed '/^$/!s/$/;/'
Adding the same prefix and suffixBrowser tool: run prefix then suffix, or one-shot regex s/^(.*)$/prefix$1suffix/

Frequently asked questions

How do I add a comma to the end of every line except the last one?

Pure suffix tools always add to every (non-blank) line, last one included. The clean approach is to add to all, then delete the trailing comma from the final line manually — takes two seconds. For automation, sed's last-line check works: sed '$!s/$/,/' file.txt — the $! means "not the last line".

How do I wrap each line with both a prefix and a suffix?

Three short paths. (1) Run prefix, then suffix on the result. (2) Excel: ="(" & A1 & ")". (3) On the command line: sed 's/.*/(&)/' file.txt — the & stands in for the whole matched line.

How do I add different suffixes to different lines?

That's a per-row join, not a suffix. Put the suffix values in a second column and concatenate: in Excel, =A1 & B1; on the command line, paste -d "" content.txt suffixes.txt; in any language, zip the two lists and concatenate per row. The fixed-string suffix tool is the right tool when the suffix is the same for every line.

Can I add a suffix that contains a newline?

Yes, but that's effectively duplicating each line, not suffixing. The browser tool treats input literally — if you paste a newline character into the suffix box (some browsers won't let you type Enter directly; copy a newline from the document), each output line will be followed by an empty line. For cleaner control, use sed: sed 's/$/\n/' file.txt on GNU sed.

How do I undo a suffix I already added?

Treat it as a Find & Replace at end of line: search suffix$ (with regex on), replace with nothing. On the command line: sed 's/;$//' file.txt if the suffix is ;. The browser tool doesn't have a "strip suffix" mode yet — for now, treat add and remove as separate operations.

Is it safe to paste sensitive text into an online suffix tool?

Only if the tool runs entirely in the browser. Open DevTools → Network, paste your text, run the transformation, watch for outbound requests. If any carry your data, the page sent it to a server. The joinlines suffix tool makes zero requests after page load — verifiable in DevTools.

— the joinlines team, 2026-04-08

§ — PRIVACY Your text never leaves your browser. No upload, no account, no logs on what you paste.
PRIVACY PAGE ↗