Hi, I have a huge data table where some cells have codes (e.g. ND, TR, TC, XX, etc.). This table gets updated all the time, and I read this data, and I want to get rid of these codes and just replace with zero. I have no idea how many codes are out there (a code may not be in the current table but may appear in an updated version). So, I just want to select any cell with a string and replace it zero. How can I do this? Maybe a conditional statement similar to the ISTEXT formula in Excel? Or a wildcard (*)? Thank you :-)
Solved
Can I use StringReplacer to find ANY string and replace with zero?
Best answer by markatsafe
@mary Thanks for the more complete explanation of the problem and the sample data. I think you should be able to do everything in either NullAttributeMapper . But first, on the Excel reader parameters, set Read Blank Cells As: Null (default is Missing). Then, use regex in NullAttributeMapper:
[A-Za-z]|<
NullAttributeReplacer works better here than StringReplacer as it uses 'contains' so you can use a simpler regex expression, where as StringReplacer would require a more complete expression.
A great site for testing and understanding regex expression is: https://regexr.com/
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Login to the community
No account yet? Create an account
An FME Account is required to contribute
LoginEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.






