Hi , I m creating an String with few names and converting the string to file. Using Comma as the delimiter i trying to form an CSV file using the above string. Since few names also have Comma in them , the system is considering the name as two components and is showing the names in different cell. I want to escape the comma char while writing the data to the file .The name with comma should b treated as one value and should be shown in single cell. Thanks, Swathi
I m sorry.................. may b i have asked wrong question..I want to escape the comma char while writing the data to the file –
The csv file format has an RFC where you can find how to escape a comma. See this loacation: http://tools.ietf.org/html/rfc4180 You need to use double quotes to escape line breaks, double quotes and comma's.