You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by srini <na...@gmail.com> on 2016/12/09 14:23:11 UTC

How to sort contents in a file?

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



--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/How-to-sort-contents-in-a-file-tp14183.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Re: How to sort contents in a file?

Posted by Lee Laim <le...@gmail.com>.
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 <na...@gmail.com> 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.

Re: How to sort contents in a file?

Posted by srini <na...@gmail.com>.
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.