简体   繁体   中英

How to generate random numbers with GoogleRefine or OpenRefine in GREL?

I'd like to generate random numbers in GREL. Is there any way to do this? I'd like to use a GREL phrase like:

" http://example.org/id/ " + random + ".html"

GREL has not random function, but you can use Python/Jython instead :

import random

# return a random integer between 0 and 1000
return value + str(random.randint(0, 1000)) + ".html"

Example :

在此处输入图片说明

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