Split Text by Delimiter and Wrap Quotes Online

2026-07-13

Why format text lists

IDs, names, or codes copied from logs, chat, or an Excel column are often space- or newline-separated. Config files, CSV fragments, and SQL value lists need commas or semicolons plus quotes. Doing that by hand for dozens of items is error-prone.

ComTools Text Format (Tools/Excel/TextFormat) runs locally in the browser: split → change delimiter → wrap quotes—nothing is uploaded.

What you can configure

Option Details
Source delimiter Newline, space, comma, period, custom
Output delimiter Same choices; can differ from source
Wrap mode Both sides / prefix only / suffix only / none
Wrap symbol Single ', double ", or custom (e.g. backtick)

Empty tokens are dropped; space delimiter splits on consecutive whitespace.

Example: spaces → quoted comma list

Input:

aa bb cc

Source = space, output = comma, wrap both with single quotes:

'aa','bb','cc'

Example: Excel column → CSV-style quotes

Input (one value per line):

Alice
Bob
Carol

Source = newline, output = comma, wrap both with double quotes:

"Alice","Bob","Carol"

Steps

  1. Open Text Format.
  2. Paste text on the left (or click Sample).
  3. Choose source and output delimiters.
  4. Choose wrap mode and symbol.
  5. Click Generate, then Copy.

Common scenarios

Scenario Settings
IDs as SQL string literals Source newline, output comma, single quotes both sides
Full IN (...) fragment Or use Text to SQL directly
Semicolon-separated config Source comma, output custom ;
Suffix only Wrap mode = suffix
Change delimiter only Wrap mode = none

vs Text to SQL

Need Tool
Any delimiter swap + custom wrap Text Format
Ready-made IN (N'...') Text to SQL

Both handle GUID and order-ID lists locally; prefer Text to SQL for standard Unicode N' IN clauses.

Notes

  • Embedded ' inside values is not auto-escaped to ''—escape for SQL yourself, or use Excel to SQL.
  • For bare numbers without quotes, set wrap mode to none.
  • Processing stays in the browser.

FAQ

Split on Tab?
Use custom source delimiter and paste a Tab character.

One item per line?
Set output delimiter to newline.

Same as Excel Format?
No. Excel Format styles workbooks; this tool is for plain-text delimiters.


中文版