It looks like URL Strings are just 2 characters not 3 but
${literal('%01'):urlDecode()} seems to work. Jagrut's example follows another
idea I had where I was planning on storing the actual character used in a
lookup since it appears you can store non printing characters in attributes.
Thanks
Shawn
________________________________
From: Mark Payne <[email protected]>
Sent: Tuesday, June 26, 2018 7:19:23 AM
To: [email protected]
Subject: Re: ReplaceText Special Character
Shawn,
There are certainly a few different ways to handle this. Unfortunately, it may
not be as simple and straight-forward
as you might expect, because you're trying to replace text with some
non-readable characters. Jagrut's method should
certainly work. However, a simpler solution, I think, would be to just modify
your "Replacement Value" in ReplaceText
and do something a bit 'clever':
${literal('%001'):urlDecode()}
Here, we are replacing the value with the literal value %001 (the URL-encoded
version of \u001 and then we are asking
the Expression Language to URL-Decode it. This should give you back the Unicode
001 character that you're looking for.
Thanks!
-Mark
On Jun 25, 2018, at 7:19 PM, Jagrut Sharma
<[email protected]<mailto:[email protected]>> wrote:
Hi - You can try this approach to replace the incoming delimiter with Hive's
Ctrl-A delimiter.
Flow1 -> ExecuteScript -> ReplaceText -> Flow2
ExecuteScript configuration
<image.png>
ReplaceText configuration
<image.png>
The text will be replaced with ^A delimiter which you can verify in vi.
Thanks.
--
Jagrut
On Mon, Jun 25, 2018 at 1:09 PM, Shawn Weeks
<[email protected]<mailto:[email protected]>> wrote:
I feel this is probably really simple but I'm trying to replace the delimiter
in a text file with '\001' to match Hive's default delimiter. Here is my config
which is based on a Hortonworks post from 2016 but it's not inserting ctrl+a
it's inserting the string '\001'.
Thanks
Shawn
<nifi_example.png>
--
Jagrut