package com.zoomy.excel;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.io.*;
@SpringBootTest
class ExcelApplicationTests {
@Test
void contextLoads() throws IOException {
String fileName = "test.txt";
String txt = "E:\\test\\" + fileName;
File file = new File(txt);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8"));
//数据,在TXT输出的内容
out.write("aaaa");
out.flush();// 把缓存区内容压入文件
out.close();// 最后记得关闭文件
}
}