1
salemilk OP 求助啊。。。。。。
|
2
pubby 2014-12-27 16:01:41 +08:00
保存成xx.xls后缀,excel就能打开了啊
要不然就用PHPExcel库吧 |
3
hansnow 2014-12-27 16:03:59 +08:00 via Android
保存成CSV然后用excel打开
|
4
salemilk OP @pubby http://yunpan.cn/cfCGGkXARqKhY (提取码:945d) 这个是php文件,老大不是你说的那样呀。。。。。。我要保存成这样的。
|
5
Hamniba 2014-12-27 16:18:19 +08:00
使用php-excel库,循环遍历
|
6
pubby 2014-12-27 16:19:31 +08:00
|
8
karjarjam 2014-12-27 16:36:17 +08:00
@salemilk 主楼的图看得眼花,不过看来中间是有一段固定字符的,那么先把数据粘进execel,用left嵌套find函数、mid嵌套find函数、right嵌套find函数,一拉或者cirl+Enter。当然最好是写VBA,可惜看不清。
|
9
salemilk OP @karjarjam 你说的我有点晕呀,文件已经上传到 360网盘 了,老大,一个月的迅雷会员 能帮我搞一下吗????
|
10
iscraft 2014-12-27 17:09:42 +08:00
session_start();
header("Content-type:application/vnd.ms-excel"); $now_time=date("Y_m_d_H_i_s",time()); header("Content-Disposition:attachment;filename=data_$now_time.xls"); echo "序号"."\t"; echo "年度"."\t"; echo "季度"."\t"; echo "专题"."\t"; echo "期数"."\t"; echo "培训机构"."\t"; echo "状态"."\t"; |
11
karjarjam 2014-12-27 17:17:19 +08:00
@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来验证可能括号不对称,加上就可以了。
|
13
mringg 2014-12-27 18:37:57 +08:00 via Android
我还是喜欢csv
|