4.19 格式转换 - 多个卡片式文件合并成一张行式表
有多个卡片式文件如下所示:
Andrew.Fuller.xlsx:

Janet.Leverling.xlsx:

Margaret.Peacock.xlsx:

Nancy.Davolio.xlsx:

等等…
现在需要把它们合并成一个行式表,合并后的格式如下所示:
Employee.xlsx:

实现代码:
| A | B | |
|---|---|---|
| 1 | =directory@p(“Cards/*.xlsx”) | |
| 2 | =create(ID,FirstName,LastName,Gender,Title,Birthday,HomePhone,PostalCode,Address) | |
| 3 | [B1,B2,D2,D1,B3,B4,B5,B7,B6] | |
| 4 | for A1 | =file(A4).xlsopen() |
| 5 | =A3.(B4.xlscell(~)) | |
| 6 | >A2.record(B5) | |
| 7 | =T(“Cards/Employee.xlsx”,A2) | |
A1:列出 Cards 目录下以姓名命名的所有文件
A2:创建结果序表
A3:列出需要读的卡片式文件中的单元格名
A4:循环 A1 中的文件
B4:打开文件
B5:读取文件中 A3 列出的单元格的数据
B6:把 B5 中的数据插入到 A2 中
A7:把 A2 中的序表写入 Employee.xlsx 中
帮你早下班 - esProc 桌面版与 Excel 数据处理
4.18 横纵两个方向同时合并 - 保留先出现的数据
4.20 格式转换 - 多个主子表文件合并成两张行式表

=directory@p(“Cards/..xlsx”) 此处应为 =directory@p(“Cards/..xlsx”)