Put data in category horizontally into columns
Example
The Excel file book1.xlsx records students' grades, and some of the data is shown in the figure below:
Rank the students' mathematics scores. Names with the same scores are placed in the same row. The results are shown in the following figure:
Write SPL script:
A |
|
1 |
=T("E:/work/book1.xlsx") |
2 |
=A1.group(-Maths).([#]|~.(Name)) |
3 |
=file("E:/work/book2.xlsx").xlsexport@w(A2) |
A1 read the book1.xlsx file
A2 Group by Maths and arrange in reverse order, loop each group, and merge the group number with the student's name in the group into a sequence
A3 save A2 to the file book2.xlsx, option @w means output in a sequence of sequence.
SPL Official Website 👉 http://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc
SPL Learning Material 👉 http://c.scudata.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/ydhVnFH9
Youtube 👉 https://www.youtube.com/@esProc_SPL