CSV tricks

1)-If the value contains a comma, newline or double quote, then the String value should be returned enclosed in double quotes.

2)-Any double quote characters in the value should be escaped with another double quote.

3)-If the value does not contain a comma, newline or double quote, then the String value should be returned unchanged.

 

For example

 

Mary “has a cow” and horses, frogs and “aligators”

In CSV would be

Mary,””has a cow””,”and horses, frogs and “”aligators””