You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by jamal sasha <ja...@gmail.com> on 2012/10/24 16:47:27 UTC

Removing chars from a position

Hi,
 I have data in form
12345,1
12346,1

>From the field one (id), I want to remove 2nd and fourth digit and just
output the result
So basically
Output is
12345,1,135
12346,1,136

How do I do this in pig?

Re: Removing chars from a position

Posted by Prashant Kommireddi <pr...@gmail.com>.
You can use a combination of SUBSTRING and CONCAT. It would just be
easier and more efficient if you wrote your own UDF to do this.

Sent from my iPhone

On Oct 24, 2012, at 7:47 AM, jamal sasha <ja...@gmail.com> wrote:

> Hi,
> I have data in form
> 12345,1
> 12346,1
>
> From the field one (id), I want to remove 2nd and fourth digit and just
> output the result
> So basically
> Output is
> 12345,1,135
> 12346,1,136
>
> How do I do this in pig?