-3
일부 my.xls 파일에서 requestPayLoad Json 객체를 읽고 싶습니다. 응답을 다시 작성하고 싶습니다. 어떻게해야합니까?Gatling : - scala excel 파일에서 JSON 객체를 읽으십시오.
저는 스칼라에 매우 익숙합니다. 코드 스핀이 도움이 될 것입니다.
나는이 라이브러리를 말하는 겁니다하지만
https://github.com/folone/poi.scala
을 작동하지 않습니다 나는 아래와 같은 자바 코드를 작성하지만,
public class ExcelUtils {
private static Sheet excelWorkSheet;
private static Workbook excelWorkBook;
private static Cell cell;
public static void setExcelFile(String path, String sheetName) throws Exception {
InputStream excelFileInputStream = new FileInputStream(path);
String fileExtensionName = path.substring(path.indexOf("."));
if (fileExtensionName.equals(".xlsx")) {
excelWorkBook = new XSSFWorkbook(excelFileInputStream);
} else if(fileExtensionName.equals(".xls")) {
excelWorkBook = new HSSFWorkbook(excelFileInputStream);
}
excelWorkSheet = excelWorkBook.getSheet(sheetName);
}
public static String getCellData(int rowNum, int colNum) throws Exception {
cell = excelWorkSheet.getRow(rowNum).getCell(colNum);
String cellData = cell.getStringCellValue();
return cellData;
}
public static Sheet getExcelWorkSheet() throws IOException {
return excelWorkSheet;
}
}