What defines a "line" of text? All the text in the field until you get to the first return?
If so, getValue ( TextField ; 1 ) will return the first line of text.
Let ( T = GetValue ( YourTextField ; 1 ) ;
Case ( PatternCount ( T ; "Tri-Color" ) ; "Tri-Color" ;
PatternCount ( T ; "Color" ) ; "Color";
PatternCount ( T ; "Black" ) ; "Black" ;
and so forth.....
) // case
) // let
make sure that you test for "Tri-color" before you test for "color".
Quick question If I need to add "Light Cyan" and "Light Magenta", should I be placing those before the "Cyan" and "Magenta"?
Yes, the Case function will return the value associated with the first expression to evaluate as true, so you would need to put the "light" text before the others that contain the same color name.
You could also use this expression:
Substitute ( FilterValues ( Substitute ( GetValue ( YourTextField ; 1 ) ; " " ; ¶ ) ; List ( "Color"; "Black"; "Magenta"; "Cyan"; "Yellow"; "Tri-Color" ) ) ; ¶ ; " " )
This might give you a version you could use where a related table lists the words and phrases you want to extract from this text.
Thanks for the help.
I was just going through my list and ran accross something I forgot to think about. In some few cases, I'm running accross where I have Black, and Color in the same line, I'm also realizing that there are gong to be some instances where I may have them all. I might just have to make a flag based on the pack count if it is over 1, so I can manually check them. I may have to manually fix those. I think this is a good start, but now that I really focus on it, I may just have to add some manual work to it. Thanx again....
Question as far as the manual part, if I set this up under the calulated input VS. a calculation field and say do an import via a match field and a blank field so the calculation will perform, that should let me make the field editable so where I need to fix the multiple color items i can? hope that makes sence..
My second calculation would return all instances where the words match those listed so it may serve even in cases where you have multiple colors listed--though duplicate values would also be returned and I can't tell from here if that could be a problem for you or not.
Well now that I tried your second calculation, I realized you have already answered that question, I just need to add every variation there may be to it, and it looks like it will do it all for me.