Re: How to do this ?



Leslie -

Be carefull what you wish for. Are you absolutely
sure you want to get rid of all spaces, puncuation
and formating as well? No matter what the desired
valid characters are - it seems like every character
must be tested. Assuming you can set up tcursor'ing
through your table, the meat (untested) is provided
below.

Ed


strValid = "0123456789abcd.." ; fully enumerate desireable characters
(open / edit tcursor)
....(start loop to move thru table 1 record at a time)

strIn = tcD."FieldName" ; field to be stripped
strOut = ""
for i from 1 to strIn.size()
strX = strIn.substr(i,1)
if strValid.search(strX) > 0 then ; Valid character
strOut = strOut + strX
endif
endfor
tcD."FieldName" = strOut
tcD.postrecord()

.... end loop ( & cleanup)

--------------



"Leslie Milburn" <CDB4W@xxxxxxxxxxxxxxxxxx> wrote in message
news:43fd086a@xxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,

I need to strip all punctation out of an alpha field leaving just the the
a-z, A-Z, and 0 - 9 characters.
Can this be done via a QBE or SQL Query ? and if so can anyone give an
example

Thanks
Leslie.




.



Relevant Pages

  • Re: How to do this ?
    ... valid characters are - it seems like every character ... ...(start loop to move thru table 1 record at a time) ... strX = strIn.substr ... strOut = strOut + strX ...
    (comp.databases.paradox)
  • Re: How to do this ?
    ... invalid chars): ... valid characters are - it seems like every character ... strX = strIn.substr ... strOut = strOut + strX ...
    (comp.databases.paradox)
  • session id contains invalid characters
    ... contains invalid characters, valid characters are only a-z, A-Z and 0-9 in ... invalid characters, valid characters are only a-z, A-Z and 0-9 in Unknown on ...
    (comp.lang.php)