Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- try (PrintWriter writer = new PrintWriter(new File("test.csv"))) {
- StringBuilder sb = new StringBuilder();
- sb.append("id,");
- sb.append(',');
- sb.append("Name");
- sb.append('\n');
- sb.append("1");
- sb.append(',');
- sb.append("Prashant Ghimire");
- sb.append('\n');
- writer.write(sb.toString());
- } catch (FileNotFoundException e) {
- System.out.println(e.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement