@
salemilk 看了你的文件后轮到我有点晕(不懂PHP),这是要下下来运行出结果吗?看上去只需要只要在循环里加入写入Excel 表第i行第j列(country j=1,Region/State j=2,etc)。如果要处理主楼那张图里那样的,那么A列贴结果。B列处理出country值,函数=(A1,2,2),C列Region/State,函数=MID(A1,6,FIND(",",A1,6)),C列处理Region,函数=MID(A1,FIND(",",A1,FIND(",",A1,6))+2,FIND(",",A1,FIND(",",A1,FIND(",",A1,6))-1) ,D列处理出Postcode值,函数=MID(A1,FIND(",",A1,FIND(",",A1,FIND(",",A1,6))+2,FIND(",",A1,FIND(",",A1,FIND(",",A1,FIND(",",A1,6)))-1) ,E列处理出Weigh值,=MID(A1,FIND(",",A1,FIND(",",A1,FIND(",",A1,FIND(",",A1,6)))+2,FIND(",",A1,FIND(",",A1,FIND(",",A1,FIND(",",A1,FIND(",",A1,6)))-1) ,就是继续加FIND(",",A1, *)的嵌套。F列也是,=MID(A1,FIND(",",A1,FIND(",",A1,FIND(",",A1,FIND(",",A1,FIND(",",A1,6))))+2,LEN(A1)-1)。把函数连括号贴到对应的列里,每贴完一次往下拉,完成后删除A列。VBA没时间就不说了。没用EXCEL来验证可能括号不对称,加上就可以了。