2019独角兽企业重金招聘Python工程师标准>>>
问题:遍历如下数据,取得每一列的值,并重新进行排序。
2012-2013春季,50,24,0,240,250,1690,住宅,146, 100.0;
2013-2014秋季,50,20,0,0,250,1250,低保户,145, 100.0;
分析:该数据分割两次。“;”首分割,“,”次分割。
实现:
<#list orderpaydetail.attributeItems['qfndxx']?split(";") as qfndxx>
<#list qfndxx?split(",") as attrList>
<#if attrList_index == 0>
${attrList}
#if>
#list>
<#list qfndxx?split(",") as attrList>
<#if attrList_index == 7>
${attrList}
#if>
#list>
<#list qfndxx?split(",") as attrList>
<#if attrList_index == 8>
${attrList}
#if>
#list>
<#list qfndxx?split(",") as attrList>
<#if (attrList_index >= 1 && attrList_index < 7)>
#if>
#list>
<#list qfndxx?split(",") as attrList>
<#if attrList_index == 9>
${attrList}
#if>
#list>
#list>
Ps: 如上遍历会产生空值行,什么原因我没有验证。 我的解决方案是: 将该行删除。
$(document).ready(function() {
$("#last").prev().remove();
});