October 23, 200520 yr I 've been trying unsuccessfully to extract the word "ERROR" from a field that contains a email transmisson log. I hoped to find a way to transfer the word "ERROR" (should it be present) to a different field using a calculation field. Since these messages are variable in length, using "Right" "Middle" "Left" don't seem practical. Is there a way to search or filter the field (without entering Find Mode) for the word and cause it to appear in the another field by calculation? Otherwise, how would I extract the word if I felt certain that it were the 19 th word from the end?
October 23, 200520 yr You can use the PatternCount() function to find out how many times a word appears in another field. Therefore,you could write: Case ( PatternCount ( emailField ; "error" ) = 0; ""; "error" ) to get the result you want.
October 23, 200520 yr Author Thanks Kent! Your PatternCount tip works perfectly. Also, I found that I can nest the RightWords function within the PatternCount parameters to obtain # occurences, which is also useful.
October 23, 200520 yr If you want to use it even more powerfully, try combining it in calculations with the Position() function and the Left(), Middle(), or Right(), or LeftWords(), MiddleWords() or RightWords() functions. You can do some pretty cool text parsing that way. Edited October 23, 200520 yr by Guest correct spelling
October 26, 200520 yr Author I really appreciate your suggestions! I'll being going further into parsing in the near future and most likely will need to explore that tip.
Create an account or sign in to comment