Sorry for late response.
Thanks Joe. I will take a look.
So if I want to replace also new line '\n' with character representation
"\n" I will need to do this
{"test":"${teststr:replaceAll('"','\\\\"'):replaceAll('\n',  '\\\\n'}"}.
Correct?


On Wed, Apr 27, 2016 at 12:19 AM, Joe Percivall <joeperciv...@yahoo.com>
wrote:

> Hello Igor,
>
> I got your template working by using the below replacement string and
> changing the "Replacement Strategy" to "Always Replace". I've attached a
> template that works for me.
>
> {"test":"${teststr:replaceAll('"','\\\\"')}"}
>
>
> The backslashes are a bit weird because they escape characters and are
> used to escape themselves. So when you're trying to use them explicitly it
> can lead needing to repeat them multiple times (in this case 4).
>
> Hope this helps,
> Joe
> - - - - - -
> Joseph Percivall
> linkedin.com/in/Percivall
> e: joeperciv...@yahoo.com
>
>
>
> On Tuesday, April 26, 2016 6:10 PM, Igor Kravzov <igork.ine...@gmail.com>
> wrote:
>
>
>
> Attached please find the test template. NiFi 0.6.1I am trying to replace "
> with \" in a text.  So "Here "we" go" should become \"Here \"we\" go\"
>
>
> The call is in ReplaceText processor:
> {"test":"${teststr:replace('"','\\"')}"}
> teststr cerated in UpdateAttribute.
>
>
> From some reason unable to make it working. What can be wrong?
>
> Thanks in advance.
>

Reply via email to