CSV Escape / Unescape

Escape or unescape characters from input CSV content.



CSV string with Escapes or Unescapes returns string value enclosed in double quotes, if required.

Applying following rules:

  • If the value contains a comma, newline or double quote, then the String value is returned enclosed in double quotes.
  • If the value does not contain a comma, newline or double quote, then the String value is returned unchanged.
  • A double quote must be escaped with another double quote. example "The double quote character "" is escaped."

What is CSV?

A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The use of the comma as a field separator is the source of the name for this file format. A CSV file typically stores tabular data (numbers and text) in plain text, in which case each line will have the same number of fields. CSV files can be used with most any spreadsheet program, such as Microsoft Excel or Google Spreadsheets

CSV Advantages

  • CSV is human readable and easy to edit manually.
  • CSV is simple to implement and parse.
  • CSV is processed by almost all existing applications.
  • CSV provides a straightforward information schema.
  • CSV is faster to handle.
  • CSV is smaller in size.
  • CSV is considered to be standard format.
  • CSV is compact. For XML you start tag and end tag for each column in each row. In CSV you write the column headers only once.
  • CSV is easy to generate.

CSV Disadvantages

  • CSV allows to move most basic data only. Complex configurations cannot be imported and exported this way.
  • There is no distinction between text and numeric values.
  • No standard way to represent binary data.
  • Problems with importing CSV into SQL (no distinction between NULL and quotes).
  • Poor support of special characters.
  • No standard way to represent control characters.
  • Lack of universal standard.