1.创建excel文件
File testCsv = new File("test.csv");
BufferedWriter testBw = new BufferedWriter(new FileWriter(testCsv, false));
2.向表格插入数据
bw.write("部门名称,部门ID,父部门ID\n");
bw.write("测试,1,0\n");
bw.write("开发,2,1\n");
bw.newLine();
bw.close();
1.创建excel文件
File testCsv = new File("test.csv");
BufferedWriter testBw = new BufferedWriter(new FileWriter(testCsv, false));
2.向表格插入数据
bw.write("部门名称,部门ID,父部门ID\n");
bw.write("测试,1,0\n");
bw.write("开发,2,1\n");
bw.newLine();
bw.close();