Kas Posted October 23, 2005 Posted October 23, 2005 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?
Kent Searight Posted October 23, 2005 Posted October 23, 2005 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.
Kas Posted October 23, 2005 Author Posted October 23, 2005 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.
Kent Searight Posted October 23, 2005 Posted October 23, 2005 (edited) 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, 2005 by Guest correct spelling
Kas Posted October 26, 2005 Author Posted October 26, 2005 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.
Recommended Posts
This topic is 7035 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now