让我们说,我从excel获取数据,我需要映射两件事。
ID和相应的日期,Excel数据如下所示: -
{N1=2018-10-09,2018-10-10} {N1=2018-10-11}
实际输出应如下所示: -
//Fetching from using in soap ui
String id = context.expand('${Data#ID}')
String dt = context.expand('${Data#Dates}')
List arrId = id.split('#')
def strD
LinkedHashMap < String, String > dateMap= new LinkedHashMap <
String, String > ()
for(int i=0; i<arrId.size(); i++) {
strD = dt.split("#").asType(List)[i]
dateMap.put(arrId[i],strD)
}
log.info dateMap
我试过下面的代码: -
$('[data-toggle=popover]').popover({
placement : 'bottom'
});
有人可以帮我吗?
答案 0 :(得分:1)
试试这个:
def ids = "N1#N1".split('#')
def dts = "2018-10-09,2018-10-10#2018-10-11".split('#')
List<Map> result = (0..ids.size()-1).collect{
[(ids[it]): dts[it]]
}
assert result == [[N1:"2018-10-09,2018-10-10"], [N1:"2018-10-11"]]