April 3, 200817 yr I have in a call system, a field named Subject in which users input data related to the phone call received. They set the important data with the first character of the word capitalized. I would need a Custom Function that will extract that data in list. Needless to say that such data will be used for self-join relationship for portal fast searching. Example. Input (courtesy of Macintouch) Charismac released Discribe 6, an update of its CD and DVD burning software. This release is a Universal Binary and includes Leopard compatibility and an improved interface. Output: Charismac Discribe CD DVD Universal This Binary Leopard Thanks in advance.
April 3, 200817 yr Not tested (that's a challenge !) Requires CustomList CustomList ( 1 ; WordCount ( text ) ; "let ([ $w = middlewords ( text ; [n] ; 1 )] ; case ( not isempty ( filter ( $w ; upper ( $w ))) ; $w ))") Edited April 3, 200817 yr by Guest
April 3, 200817 yr In addition to what was suggested by Fabrice, take a look at Brian' Site Link I think I remember a couple (maybe more) CFs that can provide list.
April 3, 200817 yr case ( not isempty ( filter ( $w ; upper ( $w ))) ; $w ) I believe that would extract any word that CONTAINS a capital character (not necessarily the first character), and also any word that contains a number (or any other symbol that doesn't have upper/lower variants). I would try: ProperWords ( text) = Let ( [ word = LeftWords ( text ; 1 ) ; countWords = WordCount ( text ) ] ; Case ( not IsEmpty ( Filter ( Left ( word ; 1 ) ; "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) ) ; word & ¶ ) & Case ( countWords > 1 ; ProperWords ( RightWords ( text ; countWords - 1 ) ) ) )
April 4, 200817 yr I believe that would extract any word that CONTAINS a capital character (not necessarily the first character), and also any word that contains a number (or any other symbol that doesn't have upper/lower variants). True, it should be filter ( left ( $w ; 1 ).... But filtering only our 26 capital letters would omit Å, Ç... and other beautiful things this world contains }:(
April 4, 200817 yr filtering only our 26 capital letters would omit Å, Ç... and other beautiful things this world contains True, and if any of those "beautiful" characters are expected, you need to modify your filtering string. Otherwise you will get a false positive on a word that begins with a numeric character. Or a word that begins with the micro sign, e.g. "µmeter". Or any word that begins with an Arabic character... (as long as we are being esoteric).
April 4, 200817 yr Author Hi, Thanks a lot to all posters. Both Fabrice CustomList's twist and comment's ProperWords do work flawlessly. As indicated after the Spanish special characters need minimal recode in comments' work. BTW I checked before posting BDunning's site but I worked on the "extract" and Uppercase keywords thus CustomList did not appear. Also tried in FMForums searching. I also have to reckon the tremendous work behind that CustomList's function. Agnes, Fabrice... what a coding! Yours,
Create an account or sign in to comment