Support Questions

Find answers, ask questions, and share your expertise

Remove last line “footer” from flow file text content

avatar
Explorer

Hi 

 

I have a flow file with text content 

I want to remove the last line out of this content 

 

Input example :-

Aaa

Bbb

Ccc

Footer

 

Expected output:-

Aaa

Bbb

Ccc

 

How I can accomplish this?

 

 

1 REPLY 1

avatar
Super Guru

Hi,

you can use  ReplaceText by setting the Evaluation Mode property to "Line-by-Line", then set the "Line-by-Line Evalaution Mode" to "Last Line". In the Replacement  Value set it to Empty String Set and the Search Value leave as "(?s)(^.*$)" as seen in the screenshot below:

SAMSAL_0-1660161323285.png

 

If you find this helpful please accept solution. Thanks