nembel / apps / sqlcolq
app name
SQL: quote cols for csv/tsv
command
/sqlcolq
description
Convert a SQL select list so that output values are quoted suitably for use as CSV or TSV data. [EXPERIMENTAL]

Makes SQL output text usable as CSV data, especially when values contain line breaks or commas; or tabs; or other delimiters.

EXAMPLE: col1, ...
→ '"'+replace(col1,'"','""')+'"' as col1, ...

SQL output like: John "Ox" Doe
→ "John ""Ox"" Doe"

EXPERIMENTAL: Uses simple regex. Will fail for complex select lists.
how to use this app

Option 1: Click the "try it now button" above.

Option 2: Go to nembel.com and type /sqlcolq

Option 3: Install this bookmarklet: /sqlcolq

Option 4: Install the Nembel toolbar bookmarklet to instantly access hundreds of tools like this on any web page.

about nembel web apps

Nembel web applications are online tools, utilities, and search shortcuts. Each one can be used from the home page, the toolbar, or saved as separate bookmarklets. Our instant online apps can be used without logging in or signing in. No account, no signup, and no registration is required or necessary.

Many can be used directly and instantly on the Nembel home page.

Visit the home page and type keywords to see relevant tools, or browse the list at nembel.com/apps/