Support Questions

Find answers, ask questions, and share your expertise

NiFi Apache - how to remove punctuation from a single column

avatar
New Contributor

I am trying to remove the punctuation from a single column using the UpdateRecord processor.  But I am unable to get it right. I attached screenshots of my configurations and properties. 

Screenshot 2024-10-23 143224.pngScreenshot 2024-10-23 143255.pngScreenshot 2024-10-23 143324.pngScreenshot 2024-10-23 143414.png

 

 

3 REPLIES 3

avatar
Community Manager

@Mikkkk Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @steven-matison @joseomjr  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Expert Contributor

@Mikkkk 

Please check my screenshot below. I changed the "Replacement Value Strategy" property to "Literal". I also updated the dynamic user property to this  - ${field.value:replaceAll('[\\p{Punct}]', ' ')}

Here's the screenshot - 

drewski7_0-1729735113745.png

 

${field.value}: In NiFi’s Expression Language, field.value refers to the current value of the field being processed in a record (for example, the value of the ENTITY_NAME field if that’s what you’re working on).

:replaceAll('[\\p{Punct}]', ' '): This function searches the field.value for any punctuation characters (using the [\\p{Punct}] regex) and replaces each occurrence with a space.

 

Please "Accept the solution" if it helped!

avatar
Community Manager

@Mikkkk Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.  Thanks.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: