String filepass= "c:/tmp/aa.csv";
try (BufferedWriter output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filepass),"UTF-8")))
{
StringBuffer result = new StringBuffer();
result = new StringBuffer();
result.append("\"");
result.append("aa");
result.append("\"");
result.append(",");
result.append("\"");
result.append("bb");
result.append("\"");
result.append("");
output.write(result.toString());
output.write("\r\n");
//new line
result = new StringBuffer();
result.append("\"");
result.append("cc");
result.append("\"");
result.append(",");
result.append("\"");
result.append("dd");
result.append("\"");
result.append("");
output.write(result.toString());
output.write("\r\n");
//close
output.close();
} catch (IOException e) {
}
try (BufferedWriter output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filepass),"UTF-8")))
{
StringBuffer result = new StringBuffer();
result = new StringBuffer();
result.append("\"");
result.append("aa");
result.append("\"");
result.append(",");
result.append("\"");
result.append("bb");
result.append("\"");
result.append("");
output.write(result.toString());
output.write("\r\n");
//new line
result = new StringBuffer();
result.append("\"");
result.append("cc");
result.append("\"");
result.append(",");
result.append("\"");
result.append("dd");
result.append("\"");
result.append("");
output.write(result.toString());
output.write("\r\n");
//close
output.close();
} catch (IOException e) {
}