You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by prabhu Mahendran <pr...@gmail.com> on 2017/02/20 14:51:24 UTC

Split csv file into multipart.

I have CSV File which having below contents,

*Input.csv*

 Sample NiFi Data demonstration for below
Due dates 20-02-2017,23-03-2017

My Input No1 inside csv,,,,,,
Animals,Today-20.02.2017,Yesterday-19-02.2017
Fox,21,32
Lion,20,12

My Input No2 inside csv,,,,
Name,ID,City
Mahi,12,UK
And,21,US

Prabh,32,LI

I need to split above whole csv(Input.csv) into two parts like
*InputNo1.csv* and *InputNo2.csv*.

For InputNo1.csv should have below contents only.,

Animals,Today-20.02.2017,Yesterday-19-02.2017
Fox,21,32
Lion,20,12

For InputNo2.csv should have below contents.,

Name,ID,City
Mahi,12,UK
And,21,US

Prabh,32,LI

Is this possible to convert csv into Multiple parts in NiFi possible with
existing processors?

Re: Split csv file into multipart.

Posted by prabhu Mahendran <pr...@gmail.com>.
Andy,

Thank you so much for your answer.

It worked.

Thanks

On Mon, Feb 20, 2017 at 9:31 PM, Andy LoPresto <al...@apache.org> wrote:

> Prabhu,
>
> I answered this question and provided a template on StackOverflow [1].
>
> [1] http://stackoverflow.com/a/42353526/70465
>
> Andy LoPresto
> alopresto@apache.org
> *alopresto.apache@gmail.com <al...@gmail.com>*
> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
>
> On Feb 20, 2017, at 6:51 AM, prabhu Mahendran <pr...@gmail.com>
> wrote:
>
> I have CSV File which having below contents,
>
> *Input.csv*
>
>  Sample NiFi Data demonstration for below
> Due dates 20-02-2017,23-03-2017
>
> My Input No1 inside csv,,,,,,
> Animals,Today-20.02.2017,Yesterday-19-02.2017
> Fox,21,32
> Lion,20,12
>
> My Input No2 inside csv,,,,
> Name,ID,City
> Mahi,12,UK
> And,21,US
>
> Prabh,32,LI
>
> I need to split above whole csv(Input.csv) into two parts like *InputNo1.csv* and *InputNo2.csv*.
>
> For InputNo1.csv should have below contents only.,
>
> Animals,Today-20.02.2017,Yesterday-19-02.2017
> Fox,21,32
> Lion,20,12
>
> For InputNo2.csv should have below contents.,
>
> Name,ID,City
> Mahi,12,UK
> And,21,US
>
> Prabh,32,LI
>
> Is this possible to convert csv into Multiple parts in NiFi possible with
> existing processors?
>
>
>

Re: Split csv file into multipart.

Posted by Andy LoPresto <al...@apache.org>.
Prabhu,

I answered this question and provided a template on StackOverflow [1].

[1] http://stackoverflow.com/a/42353526/70465 <http://stackoverflow.com/a/42353526/70465>

Andy LoPresto
alopresto@apache.org
alopresto.apache@gmail.com
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On Feb 20, 2017, at 6:51 AM, prabhu Mahendran <pr...@gmail.com> wrote:
> 
> I have CSV File which having below contents,
> 
> Input.csv
> 
>  Sample NiFi Data demonstration for below
> Due dates 20-02-2017,23-03-2017
> 
> My Input No1 inside csv,,,,,,
> Animals,Today-20.02.2017,Yesterday-19-02.2017
> Fox,21,32
> Lion,20,12
> My Input No2 inside csv,,,,
> Name,ID,City
> Mahi,12,UK
> And,21,US
> 
> Prabh,32,LI
> I need to split above whole csv(Input.csv) into two parts like InputNo1.csv and InputNo2.csv.
> For InputNo1.csv should have below contents only.,
> 
> Animals,Today-20.02.2017,Yesterday-19-02.2017
> Fox,21,32
> Lion,20,12
> 
> For InputNo2.csv should have below contents.,
> 
> Name,ID,City
> Mahi,12,UK
> And,21,US
> 
> Prabh,32,LI
> 
> Is this possible to convert csv into Multiple parts in NiFi possible with existing processors?
>