Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Replacetextprocessor remove blank lines

avatar
Expert Contributor

Hi All,for eg

Thanks a lot this awesome community

I was trying to modify my flowfile to not have a blank line. for example right now it is like

This is message1

This is message2

I want to remove that middle blank line, so it wil become

This is message1
This is message2

I am using replacetextprocessor , but not able to figure out the replacement value?

Attached is my attempt, any pointers or help

Thanks

nifireplace.png

Dheeru

1 ACCEPTED SOLUTION

avatar
Rising Star

Hi,

You almost got it right 🙂

43504-replace.png

In the Replacement Value: type "Shift-Enter" -- this will add a new line as replacement value.

the search value will remove all empty lines and prefix spaces.


Also i have attached a sample template : replace.xml

View solution in original post

4 REPLIES 4

avatar
Expert Contributor

I treid using the replacement text as (.*)\n but then it is showing

This is message1nThis is message2n

any ideas?

Thanks Dheeru

avatar
Rising Star

Hi,

You almost got it right 🙂

43504-replace.png

In the Replacement Value: type "Shift-Enter" -- this will add a new line as replacement value.

the search value will remove all empty lines and prefix spaces.


Also i have attached a sample template : replace.xml

avatar
Expert Contributor

@Adrian Oprea Thanks a lot, appreciate it, almost forgot about the shift +enter 🙂 Thanks again

avatar
Rising Star

yeah i know is not very intuitive 🙂