# RANGETOCSV

#### Syntax

**RANGETOCSV**(*range*; *columnDelimiter*; *rowDelimiter*; *option*)

* *range* - the range which should be converted to a csv text - ***Value type**: range with cells of value type “text”*
* *columnDelimiter* - the character which separates cell values column-wise - ***Value type**: text (optional, default value: “;”)*
* *rowDelimiter* - the character which separates cell values row-wise - ***Value type**: text (optional, default value:* CHAR(13) & CHAR(10) - i.e. a line brea&#x6B;*)*
* *option* - option to escape delimiters in the cell values - ***Value type**: constant (optional, default value:* <mark style="color:red;">escaping</mark>*)*\
  Possible values are:
  1. *<mark style="color:red;">noescaping</mark>* - delimiter characters in cell values are not converted
  2. *<mark style="color:red;">escaping</mark>* - delimiter characters in cell values are converted (see remarks)

#### Remarks

1. *rowDelimiter* can be *empty*, then only the single rows of *range* are concatenated into a column range.
2. To apply special characters like tab, carriage return or line feed, use the function **CHAR** for the delimiters (see example below).
3. If *option* is *escaping,* the delimiter characters are escaped (converted) in the following way:
   1. all double quotes of all texts in range are automatically replaced with two double quotes.
   2. if a cell value contains one of the two delimiters or a double quote.
   3. the cell value is automatically enclosed with double quotes.

#### Examples

<figure><img src="https://3148043601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL43fiRbeRtPnTjMpbGNO%2Fuploads%2Fgit-blob-713b56c11b10338a3888d76c29f961521edfc88a%2Fgrafik%20(218).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3148043601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL43fiRbeRtPnTjMpbGNO%2Fuploads%2Fgit-blob-5b3fee7ce4effaedbd4549431aaf10b669d3853b%2Fgrafik%20(442).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3148043601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL43fiRbeRtPnTjMpbGNO%2Fuploads%2Fgit-blob-a59da5bf3efa3a6db24b75bbf440eff9885c0ced%2Fgrafik%20(73).png?alt=media" alt=""><figcaption></figcaption></figure>
