【发布时间】:2016-05-12 18:35:30
【问题描述】:
我在一列中有一个长字符串,需要将其分解为多行,然后拆分为多列。数据看起来像:((a:10,b:20,c:test1)(a:40,b:50,c:test2)(a:60,b:70,c:test3))。当我应用 split 和 regexp_replace 时,我得到了类似的结果
选择 SPLIT(REGEXP_REPLACE(REGEXP_REPLACE(message, r'))',''), r'((','') ,')(') as msg FROM [mydataset.mytable]
输出:
味精a:10,b:20,c:test1
a:40,b:50,c:test2
a:60,b:70,c:test3
我要找的是:
a b c
10 20 测试1
40 50 测试2
60 70 测试3
【问题讨论】:
-
实际数据是长字符串,大约分成40行。并且行数不固定。
标签: google-bigquery