Join text lines

Merge a list into one line with your own separator between items, such as a comma, semicolon or pipe. Blank lines are skipped and edges trimmed.

Output
Enter text to see output.

What to know

This operation trims every line, discards the empty ones, and glues the rest into a single line with the text from the Separator between lines field. The default is one space, but you can type anything: a comma and space, a semicolon, a pipe with spaces around it, or nothing at all.

With red, green, an empty line and blue as three entries on separate lines and the separator set to a comma followed by a space, the output is red, green, blue. Because blanks are skipped, you never get a doubled separator where the list had a gap.

The separator is taken literally. Typing \n does not insert a line break, and spaces you type at its ends are kept, so a comma alone gives red,green,blue while a comma and space gives the more readable red, green, blue. The field is saved only until you press Reset, which puts the single space back.

Typical jobs are turning a column of e-mail addresses into a semicolon-separated recipient list, a column of IDs into a comma-separated value for a query, or tags into a single line. Compared with remove line breaks, this one lets you choose the separator, so use that other one only when a plain space is enough.

Choose a specific task 10
Related tools 4
How to use Join text lines
  1. Paste a column of values such as 101, 102, 105 on separate lines into the Text input box.
  2. Type a comma followed by a space in the Separator between lines field to replace the default single space.
  3. Check that the Output panel reads 101, 102, 105 with no separator at the very start or end.
  4. Copy the single line and paste it into your query, mail client or spreadsheet cell.

Quick answers

Can I use a line break as the separator?

No. The separator is inserted exactly as typed, so \n appears as a backslash and an n. To keep lines, you do not need this operation at all.

Are blank lines turned into extra separators?

No, empty lines are skipped, so the items are joined with exactly one separator between neighbours.

Are spaces at the ends of each item kept?

No, each line is trimmed before joining, so 101 with trailing spaces becomes 101.

How do I join without any separator?

Clear the Separator field so it is empty, and the lines run together directly, for example 101102105.