Support Questions
Find answers, ask questions, and share your expertise

Replacetextprocessor remove blank lines

Solved Go to solution

Replacetextprocessor remove blank lines

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

Accepted Solutions

Re: Replacetextprocessor remove blank lines

Contributor

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

Re: Replacetextprocessor remove blank lines

Contributor

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

This is message1nThis is message2n

any ideas?

Thanks Dheeru

Re: Replacetextprocessor remove blank lines

Contributor

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

Re: Replacetextprocessor remove blank lines

Contributor

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

Re: Replacetextprocessor remove blank lines

Contributor

yeah i know is not very intuitive :)