Support Questions

Find answers, ask questions, and share your expertise

find line with string and remove blank space nifi

avatar
New Contributor

i have a flowfile text and i need remove a blank space in specific line (find line with string) :

 

example :

toto tata toto titi

serve ng angular

to bind sspk nifi processor camelCase

 ==> find (bind) :

output :

toto tata toto titi

serve ng angular

to bindsspknifiprocessorcamelCase / to bind_sspk_nifi_processor_camelCase

 

tkt u

1 REPLY 1

avatar
Super Guru

you can do that using ExtractText Processor to extract the line that you need with word "bind" into an attribute using regular expression "(bind.+$)", then you ReplaceText processor to basically located the same line using the same regular expression and the the replacement  value is the attribute from the ExtractText processor (assume its called XYZ) like this ${XYZ:replace(" ","")}