apache pig - want to replace \ in pig latin using replace command -
i have file having data below in pig
<"{\"action\": \"ac_data\",\"data\":{\"nn1\":\"0000000\",\"zerosquare\":\"newuser\",\"nacde\":\"catlogue\",\"user123\":\"99000200340904\",\"lcadq\":\"89148000001972298094\",\"reserve\":\
and want remove \ , output should below
<"{"action": "ac_data","data":{"nn1":"0000000","zerosquare":"newuser","nacde":"catlogue","user123":"99000200340904","lcadq":"89148000001972298094","reserve":
input :
<"{\"action\": \"ac_data\",\"data\":{\"nn1\":\"0000000\",\"zerosquare\":\"newuser\",\"nacde\":\"catlogue\",\"user123\":\"99000200340904\",\"lcadq\":\"89148000001972298094\",\"reserve\":\
pig script :
a = load 'input.csv' line; b = foreach generate replace(line,'([\\\\]+)',''); dump b;
output :
(<"{"action": "ac_data","data":{"nn1":"0000000","zerosquare":"newuser","nacde":"catlogue","user123":"99000200340904","lcadq":"89148000001972298094","reserve":)
ref :
Comments
Post a Comment