thinker007 / google-refine

Automatically exported from code.google.com/p/google-refine
0 stars 0 forks source link

Array literals in GEL #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Array literals should be supported in GEL so a user could say, loop through a 
bunch of columns to concatenate their 
contents into single column, for example: 

forEach(["narr1","narr2","narr3","narr4"], v, if(isNonBlank(cells[v].value), 
cells[v].value, "")).join(" ")

Would join the columns "narr1 ","narr2","narr3", and "narr4" into a single 
column. Right now, you just get an error if you try. 

You can accomplish this today with something like:

forEach("narr1,narr2,narr3,narr4".split(","), v, if(isNonBlank(cells[v].value), 
cells[v].value, "")).join(" ")

But it'd be nice to be able to work with arrays as well as strings.

Original issue reported on code.google.com by thejeffl...@gmail.com on 18 May 2010 at 10:11

GoogleCodeExporter commented 9 years ago
This should probably be an enhancement. I didn't see the option. 

Original comment by thejeffl...@gmail.com on 18 May 2010 at 10:11

GoogleCodeExporter commented 9 years ago

Original comment by iainsproat on 19 May 2010 at 5:25

GoogleCodeExporter commented 9 years ago

Original comment by dfhu...@gmail.com on 20 May 2010 at 5:40

GoogleCodeExporter commented 9 years ago
Fixed by r833. Please verify.

Original comment by dfhu...@gmail.com on 20 May 2010 at 5:49

GoogleCodeExporter commented 9 years ago

Original comment by tfmorris on 18 Sep 2012 at 2:22

GoogleCodeExporter commented 9 years ago

Original comment by tfmorris on 18 Sep 2012 at 2:56