Quote Each Line

Wrap each line in quotes. Inner quotes can be doubled for CSV or escaped with a backslash.

Quotes around each line, not a prefix on the whole text

CSV and many configs want every value in quotes, with quotes inside the value doubled. This page wraps each line. It is narrower than prefix and suffix, which can add any text and does not know about CSV doubling.

How to use it

  1. Paste one value per line.
  2. Choose the quote character: double or single.
  3. Choose what happens to a quote that is already inside the line. “Double them (CSV)” is the default and turns " into "" inside double quotes. “Backslash” writes \". “Leave them” does not touch the inside.
  4. “Skip empty lines” drops blank lines instead of emitting "".
  5. The example say "hi" then next becomes a quoted CSV-style line and a second quoted line.

What the output is

Each kept line is the quote, the possibly escaped text, and the same quote. Line breaks between values stay. The page does not add commas, so it is not a full CSV row. If you need commas between fields, join them after. Inner quotes of the other kind are left alone: a single quote inside double quotes is not doubled.

Where people use it

  • Preparing a column of values before they go into a CSV.
  • Wrapping lines for a language that wants quoted strings.
  • Making a list safe to paste where a bare comma would split fields.

Questions

Why did the quote become two quotes?

CSV escaping doubles an inner quote. Switch to Backslash or Leave them if you wanted a programming-language string instead.

I needed the same text before and after, not quotes.

Use prefix and suffix for an arbitrary wrapper.