xlate question
Mike Schwartz-PC Support & Services
mschw at athenet.net
Thu Jan 20 13:45:33 PST 2005
> bounces at lists.celestial.com] On Behalf Of Matthew Williams
>
> I would like to replace any commas and single quotes in a field with
> blank spaces with xlate, however I can only figure it out to eliminate
> one or the other, how would I do it with multiple ascii chars? so far
> this works to eliminate one of them:
>
> rep(15)=xlate(15,chr("34")," ")
>
> That eliminates all single quotes, now I would like to also remove
> commas which is chr("44"), how do I add that to the list of characters
> to translate?
>
> This is as i'm writing out to a file on a export if that helps out any...
>
> Thanks!
> -Matt
> Hale Mfg. Co.
I think you meant to say "double quotes" in your text above, because chr 34
is a double quote.
If you use the "export word" format, you will automatically get double
quotes on each end of the fields you are exporting, so that you don't have
to worry about whether commas are included inside your fields.
However, since xlate accepts lists of characters, if you still want to
eliminate the commas, I think you could use a line like:
rep(15)=xlate(15,chr("34")chr("44")," ")
or maybe the syntax is:
rep(15)=xlate(15,chr("34")chr("44")," "" ")
Actually, let me know whether that line works or not. I don't have a system
I can test that on right now. If that doesn't work, you could always setup
another variable, like xx, and pipe the date through 2 xlate commands.
*** Mike Schwartz ***
*** PC Support & Services, Appleton, WI ***
More information about the Filepro-list
mailing list