October 7, 200817 yr I'm looking for a way to strip or filter out "accent marks" like this é The below code strips out the entire character. Filter( yourTextFieldHere ; "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`~!@#$%^&*()_+=-[];',./{}|:"<>? " ) Wondering if there is an alternative way to strip out the accent mark but keep the character?
October 7, 200817 yr Author That's assuming you know what the character is. This is a calculation field that would strip the accent mark and leave the character (whatever that would be.
October 7, 200817 yr perhaps some creative use of http://www.briandunning.com/cf/175 or http://www.briandunning.com/cf/285
October 7, 200817 yr you would have to create a nested substitute such as Substitute (text ; ["å" ;"a" ]; ["é" ; "e"] ;[ "ü"; "u"] ) basically a set for every accent you wish to substitute.
October 7, 200817 yr Author Hmm. I'll take a look at both options, luckily most accents are on the "vowels" (atleast for the characters I'm dealing with) Thanks for the suggestions, I'm sure one of them will work just fine.
October 8, 200817 yr The only way to do this in Filemaker is by multiple substitutes - which means you have to actively list all possible accented characters. There may be another way to do this outside of Filemaker - search for "Unicode decompose".
October 2, 201312 yr Yeah… I know this topic is a bit old, but this might help someone. Multiple substitutes is not the only way to do this in Filemaker. Filemaker talks AppleScript which opens the whole world ! OK Comment, strictly speaking you are doubly right. AppleScript is "outside of Filemaker" even if you write it inside, and the way to go is indeed Unicode manipulation Perl does this very well, and you can call Perl from AppleScript from Filemaker. Twisted or what !? You need a temporary field in Filemaker to pass in the string you want to check, as you can't pass variables directly to AppleScripts (yet?). As from there, in your verification script just include a "Do AppleScript" line, with the following in the script section : set the_string to field "VarTemp" of current record set p_script to ¬ "# -*- coding: utf-8 -*- import unicodedata, sys def normalize(x): normal_form_1 = 'NFKD' normal_form_2 = 'NFC' x = unicodedata.normalize(normal_form_2, x) x = x.lower() x = x.replace(u'ß', u'ss') x = x.replace(u'å', u'aa') x = unicodedata.normalize(normal_form_1, x) x = u''.join([c for c in x if not unicodedata.combining©]) x = x.encode('utf-8') return x arg = sys.argv[1].decode('utf-8') x = normalize(arg) print x" set p_script to quoted form of p_script set the_string to quoted form of the_string set the_result to (do shell script ("python -c " & p_script & " " & the_string)) set field "VarTemp" of current record to the_result * "VarTemp" being the temporary field that you set up in Filemaker. Credits to Jürgen Schell for the Python/AppleScript work. I merely integrated it into Filemaker
October 2, 201312 yr Filemaker talks AppleScript which opens the whole world ! Well, Filemaker talks AppleScript - but only when running on a MacOS platform, so strictly speaking ... Still, I suppose you could run a very similar code in Java using the ScriptMaster plugin. So now the only remaining question is what is this good for.
Create an account or sign in to comment