- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Remove all new lines in Base64 Encoded String using ReplaceText
- Labels:
-
Apache NiFi
Created on ‎12-10-2019 05:34 AM - edited ‎12-10-2019 06:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created on ‎12-11-2019 04:25 AM - edited ‎12-11-2019 04:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎12-10-2019 09:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created on ‎12-10-2019 10:14 PM - edited ‎12-10-2019 10:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Matt for you response.
Below is the sample input and desired output
Sample Input:
sdfasdjfsjdbfuk3ewqe
qweqiwqwdqw372ie=
Desired output
sdfasdjfsjdbfuk3ewqeqweqiwqwdqw372ie=
Created ‎12-11-2019 01:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@MattWho It is not newline, its CTRL M (^M) characters. I am able to see the ^M characters in vi editor.
Created on ‎12-11-2019 04:25 AM - edited ‎12-11-2019 04:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
