Questions tagged [grel]

GREL is the transformation expression language for OpenRefine (formerly Google Refine), a data wrangling application. Originally, GREL stood for "Google Refine Expression Language". Now it is usually expanded as "General Refine Expression Language".

GREL is the transformation expression language for OpenRefine (formerly Google Refine), a data wrangling application. Originally, GREL stood for "Google Refine Expression Language". Now it is usually expanded as "General Refine Expression Language".

69 questions
1
vote
1 answer

Find content inside parentheses and the word that comes before it (OpenRefine)

I'm trying to extract some text from a column on a CSV file. Here is an example: "Lorem ipsum dolor sit amet (2015), consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua (2000)." I wanna get a new column…
1
vote
2 answers

GREL multivalued JSON

I have a column with following contents in Open Refine 1. {"result":"Mango"} 2. {"result":"Banana"},{"result":"Apple"} and I need resulting column 1. Mango 2. Banana | Apple The expression I tried was "forEach(value.parseJson().result).join(' |…
Vijay Barve
  • 325
  • 1
  • 4
  • 13
1
vote
1 answer

How can I loop with multiple conditional statements in OpenRefine (GREL)

I am geocoding using OpenRefine. I pulled data from OpenStreetMaps to my datasetstructure of data I am adding a "column based on this column" for the coordinates.I want to check that the display_name contains "Rheinland-Pfalz" and if it does, I want…
chris
  • 11
  • 2
1
vote
1 answer

OpenRefine - combining rows into one record

I have a dataset with records that have been split across multiple rows. Is there an easy way to combine these values into one row? The screenshot shows what I have at present. The ID column has the same value, but the dates have been scattered…
Hev
  • 35
  • 3
1
vote
1 answer

Open Refine multiple word classification

I have a project with keywords in Google Refine. I need to select multiple keywords from the project and move them to a specific category. For example: I have a list with multiple keywords: car, sports car, luxury car, blue car... I want to…
1
vote
1 answer

Open Refine - Regroup rows values by column values

I am new Open refine user and don't know how to code. I would like to group multiple values of a column compared to an other column. I have this file ID 1 ID 2 ID1.1 ID2.1 ID1.1 ID2.2 ID1.2 ID2.3 ID1.2 ID2.4 ID1.2 ID2.5 And i'd…
1
vote
1 answer

Applying regex in Openrefine with Python

I am trying to use the value.findall() function in OpenRefine 3.4 by finding all the rows in a column that contain specific strings i.e., "WASHER", "FLAT", "10MM" and "SS"` in any random order given and return that into a new column. Here is a…
humblefool_9
  • 89
  • 1
  • 10
1
vote
1 answer

openrefine extracting values between symbols

I am trying to extract string of text from a whole field with Openrefine. This is an extract of my dataset: 172. D3B: 23Y1-Up, 27Y1-Up (36 LK) 6-S/F Rollers, 4-D/F Rollers, 2-Carrier Rollers 179. D3C: 23Y2508-UP (37LK) 6-S/F, 4-D/F, 2-T/C …
1
vote
1 answer

Extracting HTML tags with specific attributes in GREL

I can easily extract a tag the first time it appears Espitaleta, Lina And every time it appears: Espitaleta, Lina Espitaleta, Lina…
Gamaliel
  • 13
  • 2
1
vote
1 answer

GREL: qq about Templating Export and Nulls (Open Refine)

There is some expression more elegant than this to avoid printing NULLs and words "NULL"? By reading the Open Refine's docs https://github.com/OpenRefine/OpenRefine/wiki/General-Refine-Expression-Language I have done this bellow, but feels odd and…
1
vote
1 answer

Extracting week in the year with openrefine

I would like to extract the week in the year from a large dataset. I selected 'Add column based on this column' and used this script ' value.toDate("yyyy/mm/dd").datePart("weeks") ' However the result is week in the month but not year.
Arky
  • 380
  • 1
  • 4
  • 15
1
vote
1 answer

How to convert date string back to unix time with GREL (OpenRefine)

I'm working with a large CSV file with millions of rows. I'm using OpenRefine to manipulate this large data set. I have a column with date strings in this format "2017-08-17 04:36:00". And I would like to convert them to Unix time in integer format…
Scott Yu
  • 135
  • 3
  • 13
1
vote
2 answers

What GREL expression is used to get JSON values from cell in OpenRefine?

I have a csv that contains plain text entries in cells as well as JSON arrays. I'm new to OpenRefine and GREL and having troubles finding an expression to use to clean this csv. I want to get just the value of the "name" key in the JSON…
1
vote
2 answers

How to reconcile in OpenRefine by Wikipedia article title?

I want to reconcile a large number of records, of which I have the exact Wikipedia article titles (including parenthetical disambiguation). What is the best/fastest way to match this large number of records based on their exact Wikipedia title in…
CennoxX
  • 773
  • 1
  • 9
  • 20
1
vote
2 answers

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…
Erfanesi
  • 11
  • 1