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 :

can't escape backslash regex?


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -