I want to get the index of \
from a file
It enters into a state (with >>
prompt) from which I have to do Ctrl+z to come out of pig and then have to explicitly go to pig again
The code I use is
grunt> A = LOAD 'data.txt' USING PigStorage(',') AS (username:chararray, address:char array);
grunt> B = FOREACH A GENERATE INDEXOF(username, '\', 0);
>>
But when I try the same thing for other chars, I get the output The code being
grunt> A = LOAD 'data.txt' USING PigStorage(',') AS (username:chararray, address:char array);
grunt> B = FOREACH A GENERATE INDEXOF(username, 'a', 0);
grunt> DUMP B;
Output:
-1
-1
.
.
.
It even works for chars /
, <
, >
and most of the chars I have tried. Just not for \
Please suggest a solution.
Thank you.