You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Mix Nin <pi...@gmail.com> on 2013/03/01 23:28:35 UTC

Parse data with multiple delimiters and transpose rows and columns

---------- Forwarded message ----------
From: Mix Nin <pi...@gmail.com>
Date: Fri, Mar 1, 2013 at 2:26 PM
Subject:
To: user@pig.apache.org


*Hi *
*
*
*I have a file that has data as follows *
*

**AA*:11,22,33;*BB*:144,244,344;*CC*:yny;*DD*:11,33;*EE*:144,344 ; 11111

I need output as follows

 Event key

AA

BB

CC

11111

11

144

y

11111

22

244

n

11111

33

344

y


How could we write a PIG script for this.


Thanks

Re: Parse data with multiple delimiters and transpose rows and columns

Posted by Vitalii Tymchyshyn <ti...@gmail.com>.
You can try reading as single column, then splitting with reg exp and then
flattening.
2 бер. 2013 00:29, "Mix Nin" <pi...@gmail.com> напис.

> ---------- Forwarded message ----------
> From: Mix Nin <pi...@gmail.com>
> Date: Fri, Mar 1, 2013 at 2:26 PM
> Subject:
> To: user@pig.apache.org
>
>
> *Hi *
> *
> *
> *I have a file that has data as follows *
> *
>
> **AA*:11,22,33;*BB*:144,244,344;*CC*:yny;*DD*:11,33;*EE*:144,344 ; 11111
>
> I need output as follows
>
>  Event key
>
> AA
>
> BB
>
> CC
>
> 11111
>
> 11
>
> 144
>
> y
>
> 11111
>
> 22
>
> 244
>
> n
>
> 11111
>
> 33
>
> 344
>
> y
>
>
> How could we write a PIG script for this.
>
>
> Thanks
>