How to split all multi-valued columns into several columns at once in OpenRefine using GREL

113 views Asked by At

So, I have a complex XML imported into OpenRefine and merged all rows of all records to one using a GREL formula in "All => Transform". Now I have around 50 columns with each containing multiple values in each cell seperated by "|" and I want to have them in different columns.

See here for two example columns

I could apply "Edit column => Split into several columns" for each column but this would mean to do it over and over again. I am pretty sure this can be done via "All => Transform" using GREL but I haven't found a solution yet. Please help me!

1

There are 1 answers

0
MichaelMarkert On

My question already has been answered insofar as that OpenRefine (at the moment) is not able to split several columns at once. A workaround is just to "Extract..." the respective JSON code for a one-column-split from "Undo/Redo" and paste it to "Apply..." as many times as there are columns replacing the "columnName" in every pasted copy of the JSON with the one needed. See https://groups.google.com/g/openrefine/c/BMoK35CCXYo