Skip to main content
Biswa
Gold ⭐️
Dec 10, 2019 1:34 PM UTC
Solved

Remove all new lines in Base64 Encoded String using ReplaceText

Hi,

I am trying to remove all new lines from base64encoded string using replaceText processor.

Properties for replaceText processor is as follows:

Search Value : \\n

Replacement Value:$1

Character Set: UTF-8

Maximum Buffer Size: 10MB

Replacement Strategy: Regex Replace

Evaluation Mode: Line-by-Line

 

But this not working.

 

 

Biswa
BiswaAnswer
Gold ⭐️
Dec 11, 2019 12:25 PM UTC

May be it will be useful for someone.

I used searchValue as "\p{C}" and ReplaceValue as empty String

\p{C}  finds all non-printable characters.

4 replies

MattWho
Titanium ⭐️⭐️
Titanium ⭐️⭐️
Dec 10, 2019 5:46 PM UTC

@Biswa 

 

Your "Replacement Value" is set to "$1".

This means that the replacement value is the value associated to the first java regex capture group found in your configured "Search Value". 

The issue is your "Search value" contains no capture groups.

 

Perhaps providing a sample input content and desired output content would help here.

Hope this helps you,

Matt

 

Translate
Biswa
BiswaAuthor
Gold ⭐️
Dec 11, 2019 6:14 AM UTC

Thanks Matt for you response.

Below is the sample input and desired output

 

Sample Input:
sdfasdjfsjdbfuk3ewqe

qweqiwqwdqw372ie=

Desired output

sdfasdjfsjdbfuk3ewqeqweqiwqwdqw372ie=

Translate
Biswa
BiswaAuthorAnswer
Gold ⭐️
Dec 11, 2019 12:25 PM UTC

May be it will be useful for someone.

I used searchValue as "\p{C}" and ReplaceValue as empty String

\p{C}  finds all non-printable characters.

Translate