reverse order of columns after transposing
Example
There is an Excel file source.xlsx, the data is as follows:
1 |
2 |
3 |
4 |
5 |
6 |
7 |
|
8 |
9 |
11 |
|
22 |
33 |
||
44 |
Now we need to transpose the two-dimensional table of M column into M rows, starting from the M-th column, and turning into columns M-1, M-2...2, 1 in order, and the results are as follows:
4 |
7 |
11 |
33 |
44 |
3 |
6 |
9 |
22 |
|
2 |
5 |
8 |
||
1 |
Write SPL script:
A |
|
1 |
=file("source.xlsx").xlsimport@w() |
2 |
=transpose(A1).rvs() |
3 |
=file("result.xlsx").xlsexport@w(A2) |
A1 Read the excel file and read it as a sequence composed of sequences
A2 reverses the order of the columns after transposing
A3 export results to result.xlsx
Turn back, A2 is changed to: =transpose(A1).(~.rvs()), note that the order of rows is reversed here
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