Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

problem with replace text

Solved Go to solution
Highlighted

problem with replace text

Expert Contributor

I am using extract text with replace text as below

Original string:

_fwip="abc" new fwip in context as new_fwip="[This is \"new_fwip\""] and other text

extract text properties

abc: (_fwip.*")\]

replace text properties

search value: .*

replace value: ${abc.1}

I am getting the value

_fwip="abc" new fwip in context as new_fwip="[This is "new_fwip""

In the replaced text I am missing \.

Can you please help me to understand why I am missing \

Thanks for your help

1 ACCEPTED SOLUTION

Accepted Solutions

Re: problem with replace text

Super Guru
@Mark

I have tried with same configurations as you mentioned in the question in extract text and in replace text processors, The output flowfile contents from replace text processor resulting with \ in it.

Output:-

50381-output.png

Here is my configurations:-

Extract Text:-

50382-extracttext.png

Output from extract text processor:-

50383-extracttext-output.png

abc attribute value having \ in it

Replace Text:-

As Regex Replace as Replacement Strategy

50384-replacetext.png

(Or)

Replacement Strategy as Always Replace

50385-replacetext.png

Output:-

Both of these Replacement strategies are resulting same output that i mentioned as first screenshot.

Once check the attribute abc value after Extract Text processor having \ in it or not.

If you still having issue then share your flow and configs of the processors please..

1 REPLY 1

Re: problem with replace text

Super Guru
@Mark

I have tried with same configurations as you mentioned in the question in extract text and in replace text processors, The output flowfile contents from replace text processor resulting with \ in it.

Output:-

50381-output.png

Here is my configurations:-

Extract Text:-

50382-extracttext.png

Output from extract text processor:-

50383-extracttext-output.png

abc attribute value having \ in it

Replace Text:-

As Regex Replace as Replacement Strategy

50384-replacetext.png

(Or)

Replacement Strategy as Always Replace

50385-replacetext.png

Output:-

Both of these Replacement strategies are resulting same output that i mentioned as first screenshot.

Once check the attribute abc value after Extract Text processor having \ in it or not.

If you still having issue then share your flow and configs of the processors please..

Don't have an account?
Coming from Hortonworks? Activate your account here