public static String escapeCsvData(String data){
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  CsvWriter writer=new CsvWriter(new OutputStreamWriter(out),',');
  writer.setEscapeMode(CsvWriter.ESCAPE_MODE_BACKSLASH);
  try {
    writer.write(data);
    writer.close();
    out.close();
  }
 catch (  IOException e) {
  }
  return out.toString();
}

public static String escapeCsvData ( String data ) { ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; CsvWriter writer = new CsvWriter ( new OutputStreamWriter ( out ) , ',' ) ; writer . setEscapeMode ( CsvWriter . ESCAPE_MODE_BACKSLASH ) ; try { writer . write ( data ) ; writer . close ( ) ; out . close ( ) ; } catch ( IOException e ) { } return out . toString ( ) ; }
this escapes backslashes but doesn ' t wrap the data in a text qualifier .
