Hi,
I wrote the following code which inserts new columns after each header (except the first one) and adds coloured columns. However, I need the new inserted column headers to follow the names of the old headers, with _C1/_C2/_C3 added to the end (except for the ID column).
However, I'm having real issues trying to get the new headers to include the old header names. Every method I've tried has caused a bug as I can't manage to join the old and new variable names. I would really appreciate any help on this!
INTENDED INPUT:
ID |
V1 |
V2 |
001 |
A1 |
B1 |
002 |
A2 |
B2 |
INTENDED OUTPUT:
ID |
V1 |
V1_C1 |
V1_C2 |
V1_C3 |
V2 |
V2_C1 |
V2_C2 |
V2_C3 |
001 |
A1 |
|
|
|
B1 |
|
|
|
002 |
A2 |
|
|
|
B2 |
|
|
|
Thank you so much in advance
Bookmarks