openrefine - Parsing mutiple values with Google Refine -
i've csv column content (just example):
[{"qual"=>"05-admmin "name"=>"clark c coho"}, {"qual"=>"20-soc con", "name"=>"alpha s a"}, {"qual"=>"20-soc con", "name"=>"jack sa"}
i extract automatically values "name" field , separate comma, resulting in this: clarck c coho, alpha s a, jack sa , on.
i know can specific value code:
value.parsejson()[0].name
i've been reading documentation i'm not figuring out how loop between fields.
any tips?
edit: here example of column. content this:
[{"qual"=>"49-socadm", "name"=>"alvaro r l"}, {"qual"=>"49-socadm", "name"=>"gabriel g l"}]
the data in csv not in json format. not know is. kind of key-value format, not know one. in addition, lacks comma or bracket. try transform valid json, easier extract information using regular expressions. here example python / jython.
import re pattern = re.compile(r'"name"=>"(.+?)"', re.m) return ", ".join(pattern.findall(value))
Comments
Post a Comment