Hi everyone,
I am trying to get column structure and order in one file (Input1) based on a different file (Input2).
Input1
| USER1 | USER6 | USER2 | USER4 | USER9 |
| 535 | MKO | 111 | RRR | 765 |
| REEW | NJ8 | 222 | FFF | UYT |
| YRF | BHU | 333 | DFD | YTR |
| 45T | 765 | 444 | FDF | TRE |
Input2
| FIELDS |
| USER0 |
| USER1 |
| USER2 |
| USERG |
| USER4 |
| USER5 |
| USER9 |
| USER7 |
| USER8 |
| USER6 |
My current solution is very close to achieving that task. However it doesn't respect empty columns and pushes everything to the left.
| USER1 | USER6 | USER2 | USER4 | USER9 | USER0 | USERG | USER5 | USER7 | USER8 |
| 535 | MKO | 111 | RRR | 765 | | | | | |
| REEW | NJ8 | 222 | FFF | UYT | | | | | |
| YRF | BHU | 333 | DFD | YTR | | | | | |
| 45T | 765 | 444 | FDF | TRE | | | | | |
My expected result looks like this.
| USER0 | USER1 | USER2 | USERG | USER4 | USER5 | USER9 | USER7 | USER8 | USER6 |
| | 535 | 111 | | RRR | | 765 | | | MKO |
| | REEW | 222 | | FFF | | UYT | | | NJ8 |
| | YRF | 333 | | DFD | | YTR | | | BHU |
| | 45T | 444 | | FDF | | TRE | | | 765 |
If someone could take a look at my flow and give me a hint I would really appreciate it. Ideally I would like to convert the solution into a macro so it can be reused with many different column patterns.
My real data has over 50 columns.