How to escaping comma and double quote for CSV file?

We have a solution to escape comma and double quoted characters for CSV file

There are several utilities to escape text for inclusion in a CSV file. One is Apache Commons Lang.

Apache Commons Lang includes a special class to escape a variety of other chains, according to need, StringEscapeUtils.

If you mention you could use something like the following:
It is also possible to invert the way for recover the original string:

posted under |

4 comments:

Unknown said...
This comment has been removed by the author.
Unknown said...

I have error:-

StringEscapeUtils cannot be resolved

Unknown said...

I have this Error:
StringEscapeUtils cannot be resolved

can u provide steps for packages.

Vipul Chauhan said...

Hi Chaitanya,
StringEscapeUtils is not directly available in JDK.
StringEscapeUtils which included in commons-lang.jar library, and used to escape special characters in Java.

You Please download the commons-lang.jar library in http://commons.apache.org/lang/

After adding jar file into project path, include following package in your class.

import org.apache.commons.lang.StringEscapeUtils;





Post a Comment

Please provide your valuable comment.

Newer Post Older Post Home

Followers

Powered by Blogger.

Populares

Custom Search