I'm trying to access the value of a column name for a specific cell in Open Refine, so I can replace the value of the cell with the column name. I'm aware of the variable row.columnNames
that returns ALL column names but is there a way to return just the one for the current cell?
I'm trying to change a CSV from this:
Col 1 Col 2 Col 3
Row1 1 2
Row2 1
to this:
Col 1 Col 2 Col 3
Row1 Col 2 Col 3
Row2 Col 1
with a cell transformation like if(value != NULL, GetColumNameForCurrentCellSomehow, NULL)
If it's easier, I could also use R or Python to achieve this goal, but I have not found a straightforward way to do it there either.