方法1:
FileWriter fstream = new FileWriter("E:\\JENKINS自动化\\msg.txt",true);
BufferedWriter out = new BufferedWriter(fstream);
out.write("结果为:"+vars.get("biz_order_no_1")+" 可连接多个变量结果"+"\n");
out.close();
fstream.close();
方法2:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
String orderToken= vars.get("orderToken");
FileWriter fw=new FileWriter("C:\\Users\\Damai\\Desktop\\sd_script\\or.txt",true);
BufferedWriter out=new BufferedWriter(fw);
out.write(orderToken.replace("\"","")+",\r\n");
out.close();