如果文件1中数据如下:
0 147 265 649 761 878 894
147 118 384 112 117 16 4
0 1557 1817 2292 2934 2980 3448
1557 260 475 642 46 468 458
0 220 1029 1762 1951 2409 3186
220 809 733 189 458 777 164
0 1320 1968 2650 3051 3138 3288 4399 4404
1320 648 682 401 87 150 1111 5 302
0 147 265 649 761 821 878 894 898
147 118 384 112 60 57 16 4 1033
由此生成文件2内容如下:
=LOOKUP(B2,{0,147,265,649,761,878,894},{"147","118","384","112","117","16","4"})
=LOOKUP(B2,{0,1557,1817,2292,2934,2980,3448},{"1557","260","475","642","46","468","458"})
=LOOKUP(B2,{0,220,1029,1762,1951,2409,3186},{"220","809","733","189","458","777","164"})
=LOOKUP(B2,{0,1320,1968,2650,3051,3138,3288,4399,4404},{"1320","648","682","401","87","150","1111","5","302"})
=LOOKUP(B2,{0,147,265,649,761,821,878,894,898},{"147","118","384","112","60","57","16","4","1033"})
即提取文件1每2行数据,按相应格式生成文件2的一行数据。如何编程实现? |