Cabinetman Posted October 25, 2010 Posted October 25, 2010 Blank once again.... Calc. to replace the entire text in a field if it contains a certain predefined word. Example: Table::Text Field ...contains "My Dog is ugly" If (Table::Text Field ?? "ugly" ; "Removed" ; Table::Text Field )
efen Posted October 25, 2010 Posted October 25, 2010 If ( PatternCount ( fieldname; " ugly" );"Removed"; fieldname )
Cabinetman Posted October 25, 2010 Author Posted October 25, 2010 Patterncount Purpose : Returns the number of occurrences of searchString in text. Didn't help ..... but after I thought about it... I added ≥ 1 and that did it..... so thanks. If ( PatternCount ( field ; "ugly" ) ≥ 1 ;"Removed";field)
efen Posted October 25, 2010 Posted October 25, 2010 If ( PatternCount ( fieldname; " ugly" );"Removed"; fieldname ) works for me
comment Posted October 25, 2010 Posted October 25, 2010 I added ≥ 1 and that did it... There's no reason for that. Note also that PatternCount ( field ; "ugly" ) will return true when field contains "smugly".
Cabinetman Posted October 25, 2010 Author Posted October 25, 2010 (edited) Hhuuummm.... Well it didn't work until I put that in. Not sure why unless I missed some setting on the field itself. Edit: Although now it does so go figure... Edited October 25, 2010 by Guest
Recommended Posts
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