Home Forums Pig Problem with REPLACE

Tagged: 

This topic contains 1 reply, has 1 voice, and was last updated by  Pawel Kowalski 9 months ago.

  • Creator
    Topic
  • #42571

    Pawel Kowalski
    Participant

    Hi
    I’m loading a file:
    E = LOAD ‘file.txt’ using TextLoader() as (row:chararray);
    dump E;

    (1 {(R1C1),(R2C1),(R3C1)})

    This is just a row of text (yes, i know it looks like a bag…)

    Now I want to replace all ( with let’s say letter a:
    F = foreach E generate REPLACE($0,’/(‘,’a');
    dump F;

    And I receive ();

    What do I do wrong?
    Thanks
    Pawel

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #42572

    Pawel Kowalski
    Participant

    OK, I’ve found solution.
    I just have to use double // before reserved characters.

    REPLACE($0,’\\(‘,”),

    Pawel

    Collapse
Viewing 1 replies (of 1 total)