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:
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:
4 comments:
I have error:-
StringEscapeUtils cannot be resolved
I have this Error:
StringEscapeUtils cannot be resolved
can u provide steps for packages.
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.