filtering non-alphanumeric chars in processing

Scott Nelson scott at logicdatasystems.com
Thu Feb 26 10:35:22 PST 2015


Test each character for it's ascii value v the desired range:

::l="'1"
loop:l eq "100":end
::c=mid(f,l,"1");d=asc(c)
:(d ge "48" and d le "57") or (d ge "65" and d le "90") or (d ge "97" 
and d le "122"):   do something to keep this digit
:::  or do something else
:::l=l+"1";goto loop


Scott




On 02/26/2015 12:03 PM, Bruce Easton wrote:
> I need to filter out (squish out) non-alphanumeric characters from 
> small array-element strings in processing for a large amount of data.
>
> Since I am already having to, for other purposes form each string 
> character by character, I'm wondering which might be more efficient at 
> runtime (or if there would even be any noticeable difference).
>
> For each character, I could test its inclusion in the desired ascii 
> range using the asc() function;
> or for each, I could set an "okstring" to "0123...9abc...z" and then 
> test if the char is contained in said okstring;
> or for each, I could apply the char to a dummy with the alnum edit and 
> then test if the dummy is left blank.
>
> Just wondering out loud.  I haven't tried any of these against a large 
> data set - but ultimately this will be used for such, so I should soon 
> know.  I have a feeling testing against the edit result might be the 
> most efficient.
>
> Bruce
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>




More information about the Filepro-list mailing list