Re: use record reader to read text file and get line counts

2018-01-02 Thread tzhu
Hi Joe, I'm not sure how I should read the text file. I don't care about the content but just want to get the count (which is the attribute "text.line.count" from SplitText suggested by Mark above) associated with "RouteText.Route" under the same filename. If I use MergeContent, which reader can

Re: use record reader to read text file and get line counts

2018-01-02 Thread Joe Witt
Hello If you want to aggregate data by some filename/pattern use MergeContent and its correlation attribute feature. Once you've done the merging then use SplitText technique to get total line count. Thanks Joe On Tue, Jan 2, 2018 at 11:16 AM, tzhu wrote: > Hi Matt, >

Re: use record reader to read text file and get line counts

2018-01-02 Thread tzhu
Hi Matt, Thank you for your help. Now I can get the number from SplitText, but I'm stuck on aggregating the information by filename. I use RouteText to get the lines containing different strings, and after SplitText I can get the count. Then I'll have to merge the files back so that I can get the

Re: use record reader to read text file and get line counts

2017-12-22 Thread Matt Burgess
Tina, You could use SplitText with a very large value for Line Split Count (larger than any of your files would contain), and you will get the same flow file out but with an attribute called "text.line.count" that contains the number of lines in the file. Regards, Matt On Fri, Dec 22, 2017 at

use record reader to read text file and get line counts

2017-12-22 Thread tzhu
Hi, I wonder what would be a good way to read a text file. I find this article about getting the line count from a flowfile. But the example used here is to read csv files. I have some plain