使用pig删除空白

cld4siwp  于 2021-06-24  发布在  Pig
关注(0)|答案(1)|浏览(403)

我用逗号(,)分隔( csv )数据集。我想在pig脚本中删除的每个分隔符后面都有一个空格。示例行如下所示:

"Sachin", "India", "batsaman", "99", "kolkata", " ", "xyz"

删除逗号后的空白后,它应该如下所示:

"Sachin","India","batsaman","99","kolkata"," ","xyz"
kyvafyod

kyvafyod1#

将其加载到单个字段并使用replace。

A = LOAD 'data.txt' USING TextLoader();
B = FOREACH A GENERATE REPLACE($0,' ','');

相关问题