Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Remove ^@ from a flow file in Nifi

avatar
New Member

I have a file which has a bunch ^@ in it. I would like to remove these to clean up the file. I was going to use ReplaceTExt in nifi but I cant figure out the correct regex for this, any help would be appreciated. Thanks

1 ACCEPTED SOLUTION

avatar
Guru

That sounds like it could be a visual representation of a range of different control characters in the file. One thing to do would be to use a regex like [^\d\w] to greedily replace the non-ascii and non-digit characters.

View solution in original post

2 REPLIES 2

avatar
Guru

That sounds like it could be a visual representation of a range of different control characters in the file. One thing to do would be to use a regex like [^\d\w] to greedily replace the non-ascii and non-digit characters.

avatar
Super Guru

@Pat McCarthy

If you want to keep only numbers and alphas, you can use something like this:

[^0-9a-zA-Z]+

If you want also to keep some special characters like {}, you can use something like this:

[^0-9a-zA-Z{}]+

Obviously, you can add other special characters to the above regex

The following matches any non-alphanumeric characters:

[^\w\d]

Try this interactive tutorial: http://regexone.com/