Carl,
This is a great suggestion. I think you can improve the performance of your
script by moving the StringBuilder outside of the loop (or even further, simply
reading all the lines into a list and joining them with the delimiter you want):
import java.nio.charset.StandardCharsets
log.info("A
Interesting, hadn't looked at using ExecuteScript before this but looks
like ExecuteScript and Groovy would let me do what I need to do, I will
try that approach. Thanks,
Jake
On 7/28/16 2:02 PM, Carl Berndt wrote:
Hey Jake,
I had a similar issue recently. I used this .groovy script :
impo
Hey Jake,
I had a similar issue recently. I used this .groovy script :
import java.nio.charset.StandardCharsets
log.info("Add backslash R with Groovy!") ;
def flowFile = session.get();
if (!flowFile) return;
flowFile = session.putAttribute(flowFile, 'my-property', 'my-value');
flowFile = session
Thanks, creating the newline in the replacement value property with
shift-enter worked! The newline character (0x0a) was inserted into the
flowfile.
My use case is slightly more involved, I also need to insert carriage
returns (0x0d) in some cases. But I think you've given me a direction
to
Jake,
In the 'Replacement Value' you can tell it what you want then you can
hit "Shift-Enter" and it will insert the newline.
So, lets say the input you're getting into this processor is a
flowfile containing a bunch of line seperated events. If you wanted
to insert a newline in between each lin
Thanks for the reply. I tried just now using \\n with the regex replace
strategy, and it put '\n' into the flowfile instead of 'n'.
Jake
On 7/21/16 10:22 PM, Joe Witt wrote:
Jake,
Can you give \\n a try on the regex replace strategy? Let us know if
that does it.
Thanks
Joe
On Thu, Jul 21,
Jake,
Can you give \\n a try on the regex replace strategy? Let us know if
that does it.
Thanks
Joe
On Thu, Jul 21, 2016 at 11:18 PM, Jake Kugel wrote:
> Hello,
>
> Is it possible to use ReplaceText processor to insert a newline character
> (0x0a) or other special characters into a flowfile?
Hello,
Is it possible to use ReplaceText processor to insert a newline
character (0x0a) or other special characters into a flowfile? I've
tried putting \r and \n in the value of ReplaceText's Replacement Value
property, but they are inserted literally into the file (the Regex
Replace strateg