5.5 Split by row - generate one card per row
There is an employee information table Employee.xlsx, and part of the data is as follows:
Now we want to split the data to generate one card-style table for each employee in the following format, and the empty card-style file is named Card.xlsx:
The generated card-style file is named after employee name, such as:
Andrew.Fuller.xlsx:
Janet.Leverling.xlsx:
Margaret.Peacock.xlsx:
Nancy.Davolio.xlsx:
…
Script:
A | B | C | |
---|---|---|---|
1 | =T(“Employee.xlsx”) | [B1,B2,D2,D1,B3,B4,B5,B7,B6] | |
2 | for A1 | =file(“Card.xlsx”).xlsopen() | |
3 | for C1 | =B2.xlscell(B3,1;A2.field(#B3)) | |
4 | =file(A2.FirstName+“.”+A2.LastName+“.xlsx”).xlswrite(B2) |
A1: Read the data of employee information table.
C1: Define the sequence of cell names where each column of the employee information table is to be written on the card.
A2: Loop through every employee.
B2: Open the empty card-style file as an Excel object.
B3: Loop through each cell to be filled in.
C3: Fill the content of the corresponding column number in the current employee A2 into the current to-be-written cell.
B4: Store the Excel object of B2 to the Excel file named after the employee’s name.
esProc Desktop and Excel Processing
5.4 Split by row - segment by data (by filtering condition)
5.6 Split by row - split multiple cards to make one card generate one file
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.scudata.com
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/