简体   繁体   中英

Progressive number in Openrefine column

Is it possible to generate a "counter", a progressive number in a column using GREL?

For example, I would like to add value to that number to generate an identifier for each record.

Each row in an OpenRefine project has an index - a sequential number starting at zero (the first row in the project).

You can access this using 'rowIndex'.

To combine this with a value (I'm assuming the 'value' is a string) to create an row identifier I'd suggest:

From the column containing the value you want to use click the dropdown at the top of the column and choose 'Edit Column'->'Add Column based on this column' In the dialogue that appears give the new column a name (eg Row ID) then enter the following in the 'Expression' box:

rowIndex+value

Then click 'OK' and you should have your row identifier column

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM