Erfanesi
Erfanesi

Reputation: 57

Is there a function in GREL to remove many columns at once based on their headers in OpenRefine?

I have a file with 76 columns, out of which 52 columns are irrelevant and should be removed based on their column headers (i.e. string of names). OpenRefine offers the possibility to manually Re-order/remove columns but I was wondering if there is a GREL way to match header names and remove many columns at once, as I was not able to find a remove function similar to replace.

Upvotes: 1

Views: 602

Answers (2)

Adi Eyal
Adi Eyal

Reputation: 338

If the columns that you want to remove are in sequence, you can use Transpose -> Transpose cells across columns into rows

Then do the following:

From Column: First column you want to delete

To Column: Last column you want to delete

Transpose Into: Two new columns

  • Set the Key column to anything - e.g. A
  • Set the Value column to anything - e.g B

Now all of the columns you want to delete have been turned into rows and have been replaced by A and B. Finally, delete A and B and you're done.

Upvotes: 2

Thad Guidry
Thad Guidry

Reputation: 608

Did you try the menu options on the All column? All --> Edit Columns --> Re-order/Remove columns...

Upvotes: 0

Related Questions