Tech Tip: How to get rid of unwanted characters in data
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: October 11, 2001
If you've imported records with unwanted characters, you can run this simple method to loop through the particular field(s) and delete the unwanted characters (in this case ASCII code 34 the double quote).
ALL RECORDS([Table])
For (irecords;1;Records in selection([Table])) `Loops through the table
Repeat
vlResult:=Position(Char(34);[Table]Field) `Position returns 0 if Char(34) is not found
If (vlResult>0)
$Excess:=[Table]Field
[Table]Field:=Delete string($excess;vlResult;1)
SAVE RECORD([Table])
End if
Until (vlResult=0) `Loops through the same field till all Char(34) are deleted
NEXT RECORD([Table])
End for
For a list of ASCii codes please refer to
https://ftp.4d.com/aci_Technical_notes/ACIDOC/cmu/CMU10123.HTM