How to sort contents in a file?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to sort contents in a file?

srini
I have text like this in a file. This file was created by PutFile processor. I need to sort these rows based on the first column. How to sort in NiFi? Should I write custom processor to sort the rows in this file?

1029b25fd59929ab, 850
3e6df6133c93d64f, 667
a6eb9935bd04ff05, 3633
619e8c748de8e885, 2191
a7e32aff2e0b43c9, 1180
27c61ccd6e95bcd0, 884
6c8cf7a07c42ff82, 812
2cdb7cf7f75266cb, 768
5e98b7a38838dbf2, 569
d13ab00d851b79bc, 6000

thanks
Srini
Reply | Threaded
Open this post in threaded view
|

Re: How to sort contents in a file?

srini
I realized I can use ExecuteProcess here.
Reply | Threaded
Open this post in threaded view
|

Re: How to sort contents in a file?

leelaim
Srini,
You can also use execute stream command and bypass the PutFile.  The Execute Stream command processor triggers on an incoming flowfile and can execute the 'sort' on the contents and output the results to the next processor.

This approach keeps everything streaming through memory.

Lee


> On Dec 12, 2016, at 7:40 AM, srini <[hidden email]> wrote:
>
> I realized I can use ExecuteProcess here.
>
>
>
> --
> View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/How-to-sort-contents-in-a-file-tp14183p14205.html
> Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.