我用逗号(,)分隔( csv )数据集。我想在pig脚本中删除的每个分隔符后面都有一个空格。示例行如下所示:
csv
"Sachin", "India", "batsaman", "99", "kolkata", " ", "xyz"
删除逗号后的空白后,它应该如下所示:
"Sachin","India","batsaman","99","kolkata"," ","xyz"
kyvafyod1#
将其加载到单个字段并使用replace。
A = LOAD 'data.txt' USING TextLoader(); B = FOREACH A GENERATE REPLACE($0,' ','');
1条答案
按热度按时间kyvafyod1#
将其加载到单个字段并使用replace。