Skip to main content
Biswa
Gold ⭐️
December 10, 2019
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 ⭐️
December 11, 2019

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 ⭐️⭐️⭐️
December 10, 2019

@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 ⭐️
December 11, 2019

Thanks Matt for you response.

Below is the sample input and desired output

 

Sample Input:
sdfasdjfsjdbfuk3ewqe

qweqiwqwdqw372ie=

Desired output

sdfasdjfsjdbfuk3ewqeqweqiwqwdqw372ie=

Translate
Biswa
BiswaAuthor
Gold ⭐️
December 11, 2019

@MattWho It is not newline, its CTRL M (^M) characters. I am able to see the ^M characters in vi editor.

Translate