Jmeter-Beanshell获取csv的行数

2019-01-07  本文已影响0人  大象的眼泪2012

import java.io.BufferedReader;

import java.io.FileReader;

BufferedReader br=new BufferedReader(new FileReader("D:\\Jmeter\\test.csv"));

String tmpStr="";

int rowCount_cb=0;

while(tmeStr=br.readLine()!=null){

rowCount_cb++;

}

rowCount_cb=rowCount_cb-1;

vars.put("rowCount_cb",String.valueOf(rowCount_cb));

log.info("CSV文件行数:"+rowCount_cb);

上一篇下一篇

猜你喜欢

热点阅读