Home / Blog / Other text utilities

Lists and delimiters

Comma Separator Guide: Converting Plain Lists

Convert plain lines to a comma list, understand trimming and duplicate behavior, and recognize when embedded punctuation requires a real CSV writer.

Comma Separator Guide: Converting Plain Lists

A comma separator joins a plain list into one line. Start with one item per source line, choose the separator, then inspect the result before pasting it elsewhere. This is useful for a short display list such as apple, banana, cherry. It does not automatically create a correctly quoted CSV record when the items themselves contain commas or quotation marks.

Join three ordinary items

Open Comma Separator and paste these three lines. Leave Trim each item enabled and choose the comma separator.

apple
banana
cherry

The expected result is:

apple, banana, cherry

The spaces after each comma belong to this tool’s display separator. If the receiving system requires commas without following spaces, confirm that requirement and use a tool with an appropriate spacing option. A human-readable list and a machine-readable data record can look similar while following different contracts.

Decide what whitespace means

With trimming enabled, a line containing spaces around apple becomes apple. A blank line is omitted. Disable trimming if leading or trailing spaces are meaningful, for example when comparing literal test strings. The tool still joins separate lines; it is not a whitespace-preserving archival format.

Test the choice with two lines, one containing apple and another containing two leading spaces followed by banana. Compare the output with trimming on and off. Copy the result into a plain-text editor where spaces are visible. A proportional font can make a changed space difficult to notice even when the underlying characters differ.

Order and duplicates are preserved

This particular page offers a separator and a trim setting. It does not offer a duplicate-removal or sorting setting. If your source is apple, banana, apple on three lines, the result still contains apple twice in the same relative positions. Do not assume a converter silently removes repeated entries just because another list tool has that option.

That behavior matters for ordered instructions, repeated measurements and names that happen to be identical. If your actual goal is a set of unique values, make that a separate deliberate operation. Keep the original list until you have checked how case and spaces should affect uniqueness.

When an item contains a comma

Consider two source items: ACME, Inc. and North office. Plain joining produces three comma-separated fragments, which a simple downstream split could interpret as three fields. A CSV writer would instead quote the first field. Do not repair arbitrary CSV by replacing every comma with another character; some commas are content.

"ACME, Inc.",North office

For records containing embedded commas, quotes or newlines, use a CSV-aware workflow and validate the number of fields after parsing. The comma-separated field guide explains the quoting rules and provides a parser round trip. A delimiter converter cannot infer your intended table schema from an ambiguous single line.

Check the receiving application

  1. Confirm whether the destination expects a display string, individual form entries or structured data.
  2. Try three harmless items first, including one with a space.
  3. Paste the result and check whether the destination created three items or one combined item.
  4. Inspect the first and last item, duplicate entries and any punctuation.
  5. Only then convert the full list, keeping a copy of the original lines.

A contacts field may use commas as separators, while a spreadsheet import may use a regional delimiter or an explicit import setting. Database queries require parameters, not a comma-joined string of untrusted values. Choose the output format for the destination rather than treating every comma list as interchangeable.

Save and verify the result

Copy transfers the current result; Download saves a plain-text file. Reopen that file and confirm the separator and item count before using it as input elsewhere. For an empty source, an empty result is expected. Changing the separator should change only the boundaries between items, not the characters inside each item.

Reference

RFC 4180 documents a common CSV format; a plain joined list does not automatically meet that format.