title: How to handle special characters In CSV file
body: <p>i am creating csv file in my app problem i am facing is that while writing normal code for creating csv file i am able to manage new line character but can't handle (,) in content and if i am using opencsv library than it will handle (,) but if there is new line character in string then it leaves all the content next to \n. please suggest how to handle it .</p>
  
  <pre><code>  while (cursor.moveToNext()) 
           {
                    String _address=cursor.getString(cursor.getColumnIndexOrThrow("address"));
                    if(_address!=null)
                     writer.append(_address);
                    else
                       writer.append("Unknown");
  
                     writer.append(',');
  
                    String _body=cursor.getString(cursor.getColumnIndexOrThrow("body"));
                    if(_body.contains("\n"))
                        _body=_body.replace("\n", "\\n");
                   if(_body!=null)
                     writer.append('"'+_body+'"');
                   else
                      writer.append("");
                      writer.append(',');
  
                      String _IsRead=cursor.getString(cursor.getColumnIndexOrThrow("read"));
                      writer.append(_IsRead);
                      writer.append(',');
                      String SmsDate = cursor.getString(cursor.getColumnIndexOrThrow("date"));
                      writer.append(SmsDate);
                      writer.append(',');
                    // writer.append(cursor.getString(cursor.getColumnIndexOrThrow("type")));
                      if (cursor.getString(cursor.getColumnIndexOrThrow("type")).contains("1")) 
                      writer.append("Inbox");
                      else 
                      writer.append("Sent");                      
                      writer.append('\n');
              }
  </code></pre>