Need help with PIG
A = load 'input.txt' as (line:chararray);
B = foreach A generate FLATTEN(TOBAG(*));
C = FOREACH B GENERATE REPLACE(($0, '\\s+', ' ')
Need help on the last line to Replace multiple space with single space, Remove "
(Quotes) and leading 00
using APACHE PIG
Note:- Approach should NOT be field specific as there are more than 70 fields, Basically, expecting help with REPLACE or STRSTRING OR REGEX function which can perfomr mentioned operations on a line.
Input.txt
00595, ab 000cdef california "state, 00USA
00733, 0ds ds "ARIZONA 00state, USA
Expected Output
595, ab cdef califormia state, USA
733, ds ds ARIZONA state, USA