- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Replace Line Feed character in Nifi
- Labels:
-
Apache NiFi
Created ‎09-14-2017 03:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a line feed LF character in my csv file that I would like to replace with a pipe character |. ASCII value for LF is 10
How can i do that using replace text processor.
Created ‎09-16-2017 01:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should be able to use line-by-line as the Evaluation Mode in the ReplaceText processor, using \n or \\n (the slash may need to be escaped, e.g.) as the match value and | or \| as the replace value (again, the latter if it needs to be escaped to be proper regex for the pipe character).
Created ‎09-16-2017 01:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should be able to use line-by-line as the Evaluation Mode in the ReplaceText processor, using \n or \\n (the slash may need to be escaped, e.g.) as the match value and | or \| as the replace value (again, the latter if it needs to be escaped to be proper regex for the pipe character).
Created ‎09-18-2017 01:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Matt. that worked. I was curious why it does not work with the "Entire Text" evaluation mode.
Created ‎02-01-2019 08:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to do something like this ${'$1':escapeJson()} as replacement value in replaceText processor
search value being (?s)(^.*$)
evaluation mode line-by-line
bt this is not working as expected.
can you please help if i need to replace each line of file with jsonescaped content
