tags:

views:

105

answers:

3

If want to store user created strings in a csv file. Is there a preferred library to use for Escaping the string or should I write my own function?

A: 

Look here:

http://en.wikipedia.org/wiki/CSV_application_support

vidicon
+1  A: 

I suggest you use one of the libraries recommended by the post(s) here. While it may seem easy to write your own CSV creator/parser, you are going to run into issues where you need to handle scenarios such as user strings with commas or quotes in them, which can sometimes be quite cumbersome. I used the following libraries and they worked fine:-

limc
A: 

If you are writing your own implementation , then here is RFC for you reference: http://tools.ietf.org/html/rfc4180

If your string are not too complicated you can easily develop small function rather than using some library. I have referenced above RFC and created small function for same purpose in one of my projects.

YoK