Aussie John Posted November 12, 2007 Posted November 12, 2007 Hi i would like to strip out the vowels from a string. Thats fairly easy but to make the resultant string fairly readable I need the first letter of any separate word to keep the vowel. eg Office: Academic = Offc: Acdmc any ideas? thanks
Vaughan Posted November 13, 2007 Posted November 13, 2007 Sounds like a job for a recursive custom function. It nds t lv th frst lttr of ech wrd bt strp th vwls frm th rst of th wrd.
The Shadow Posted November 13, 2007 Posted November 13, 2007 This was much harder than it appears to be. Its tricky to keep the punctuation and spacing between the words. Give this a try and see what you think. stripVowel.fp7.zip
Aussie John Posted November 13, 2007 Author Posted November 13, 2007 Thanks guys - I can see custom functions is something I need to pay some attention to
fabriceN Posted November 13, 2007 Posted November 13, 2007 (edited) Just for fun. A "simple" calculation... but please do not find too many word separators ! (handled blank, CR and dash). A recursive function has its limit for long texts. stripVowel2.fp7.zip Edited November 13, 2007 by Guest
comment Posted November 13, 2007 Posted November 13, 2007 You should also pay attention to your profile - I would not suggest a custom function to you, unless you indicated you have Advanced. BTW, if all the words are in title case as in your example, it's a simple matter of substituting out all lower-case vowels (the Substitute function is case-sensitive).
Agnès Posted November 13, 2007 Posted November 13, 2007 (edited) Hello ! I like Substitute and I like Evaluate Too... I try this Calculation Let ([ listA = "a|a e|e i|i o|o u|u y|y A|A E|E I|I O|O U|U Y|Y à|à â|â ä|ä ö|ö ô|ô ù|ù ï|ï é|é è|è ê|ê" ; // Charge Letter|LetterSpaceLetter|Letter Result = "["" & Substitute ( listA ; [ "|" ; "";"|" ] ; [ " " ; ""] ; ["" ] ) & ""] ; [ " |" ; " " ] ; [ "-|" ; "-"] ; [" & quote(¶ & "|") & ";" & quote(¶) & "] ; ["|" & Substitute ( listA ; [ "|" ; "";""/*" ] ; [ " " ; "*/] ; ["|" ] ) & ""*/] ; ["§ " ; ""] )" ]; Evaluate ( "Substitute ( "§ " & stripVowel::txt ; " & Result ) ) "Just for fun too" Agnès ------------------------ [Try to Explain "Result" Substitute ( listA ; [ "|" ; "";"|" ] ; [ " " ; ""] ; ["" ] ) & ""] ; <- This part substitute a by |a, e by |e .... [ " |" ; " " ] ; [ "-|" ; "-"] ; [" & quote( & "|") & ";" & quote(¶) & "] ; <- This part for space; "-" or ¶ to preserve the first letter ( to locate space, "-" or ¶ in left of a word ) ; ["|" & Substitute ( listA ; [ "|" ; "";""/*" ] ; [ " " ; "*/] ; ["|" ] ) & ""*/] ; <- This part substitute a by nothing, e by nothing .... ["§ " ; <- And this one for the first blank ] Edited November 13, 2007 by Guest .....
Recommended Posts
This topic is 6280 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