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

I am trying to update the timestamp in flow file content which is in third line of mail(flowfile).Please help me how to update only time stamp in flow file

New Contributor

please help me in updating

Date: Thu, 14 Sep 2017 00:00:00 -0000 to

Date: Thu, 14 Sep 2019 00:00:00 -0000 in flow file content nifi.

1 REPLY 1

Master Guru
@praneetha satya

-

If the content of your FlowFile is just ascii text you can use the ReplaceText processor to edit that content. You would configured this processor with a Java regular expression that would single out "2017" in to a set of capture groups. The replacement text value would use some of those capture groups and your new value.

-

Here is a online regex tester:
http://myregexp.com/index.html
-

Using a FlowFile with just "Thu, 14 Sep 2017 00:00:00 -0000", i configured a ReplaceText processor with:
Search Value: (.*?, \d{1,2} \w{3}) (\d{4}) (.*)$ . <--- This creates 3 capture groups (capture group 2 is the "2017")

Replacement Value: $1 2019 $3 . <--- sets a replacement value of (capture group 1)(space)(2019)(space)(capture group 3)

-

Thank you,

Matt

-

If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.