I have a very simple workspace that just tests whether a string has a “.” Or a “:’ in it and if it does then these characters are deleted. I am using the Testfilter to test for the characters, and then a stringreplacer to delete them and then I must make sure the string is all caps. Is there a way to do these three operations by using the String Functions in the Testfilter? I haven’t been able to figure out how the string functions work. Also, will using the string functions speed up the translation? I have 47 million records to test and right now it takes 4 hours to run. I am using FME2018. I have included the workspace and source CSV file. Thanks.
Using String Functions in the TestFilter
Best answer by hollyatsafe
Hi @bd,
You can indeed do this all using String Functions however I do not believe they are available in the Test Filter so I would use the Attribute Manager and set up Conditional values for the STRING attribute.
Set up two tests to look for whether the string contains "." or ":" and then set the net attribute value to
@UpperCase(@ReplaceString(@value(STRING),.,""))
@UpperCase = to make sure outcome is all caps followed by
@ReplaceString(<string>,<before>,<after>) and change before to . or : accordingly. For the after you must put "" otherwise FME doesn't recognize that this is asking the string to be replaced with nothing and will fail.
Lastly set anything else to also be changed to upper case.
Having quickly done both methods on your test data I did find using string functions faster - 4.1 vs 7.1 seconds using FME 2018.1 (approx 40%), so I do believe this would improve performance. Ps your fmw file was not uploaded so this was using a mock up based on how I believe you did it before.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.