//每次运行都能先删掉之前的旧文件
String path="D:\\jmeter\applyno.txt";
File file=new File(path);
file.delete();

//指定需要写入到哪个文件
FileWriter fstream = new FileWriter("D:\\jmeter\applyno.txt",true);
//创建一个字符缓存输出流
BufferedWriter out = new BufferedWriter(fstream);

out.clear();
out.write(vars.get("prtNo")+","+vars.get("policyno")+"\n");
//关闭写数据流
out.close();
//关闭文件
fstream.close();