Good afternoon all,,

I am trying to remove the first line of a file if it has a certain word in
it "ERROR"
I know it will exist only in the first line ( I can not fix the reason why
it gets put there )

These files are big and lots of them.

and I can not find a "fast" fix to pop the first line of a file, everything
I can think of within NIFI ends up at least running through the whole file.

I am using RouteText suggested at one time on separate thread.

Routing Strategy: Route to "matched" if the line matches any condition.
Matching Strategy: Satisfies Expression
My expression: ${lineNo:lt(2):and($line:find('ERROR')})}

I then route "matched" to auto-terminate and unmatched as my "new" file
without the first line.

This seems to be working but it is slow since I believe it still at least
runs through the whole file line by line.

Is there any other suggestions?  I've read the "ExecuteGroovy" solutions
but they seem excessive if all I want is to remove first line of file.

I've also looked at ReplaceText and thought that would give me a clean
solution since I thought I could control input stream with the "Maximum
Buffer Size" but that is a conditional setting and if "evaluation Mode" is
Line-by-Line then I later learned "Maximum Buffer" is only for the buffer
size of the line.

Thanks

Reply via email to