Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Characters following character data in field
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01180814
Message ID:
01180819
Views:
16
Cecil,

You may get rid of bad chars using something like

lcNormalChars = [1234567890abcd...ABCD...]

lcString = chrtran(m.lcString, chrtran(m.lcString, m.lcNormalChars, space(10+26+26)), SPACE(10+26+26))

>I am getting strange looking characters following the data in the character fields. I even padded with Blanks in order to try to compensate for this.
>
>
>SELECT Patients
>DO WHILE NOT FEOF(nFileHandle)
>  * Grab 112 characters, strip off the first nine
>  cString=FREAD(nFileHandle, 112)
>  lcFirstName=PADR(ALLTRIM(SUBSTR(cString, 10, 29)), 29, " ")	&& First Name
>  lcLastName =PADR(ALLTRIM(SUBSTR(cString, 39, 29)), 29, " ")	&& Last Name
>  lcSSN      =PADR(ALLTRIM(SUBSTR(cString, 68, 11)), 11, " ")   && SSN
>  lcDOB      =SUBSTR(cString, 97, 8)	&& Date of Birth
>  lcDOBMonth =SUBSTR(lcDOB,5,2)
>  lcDOBDate  =SUBSTR(lcDOB,7,2)
>  lcDOBYear  =LEFT(lcDOB,4)
>  lcDOBDate  =lcDOBMonth + "/" + lcDOBDate + "/" + lcDOBYear
>  ldDOB      =CTOD(lcDOBDate)
>  lcGender   =PADR(ALLTRIM(SUBSTR(cString, 106, 1)), 1, " ")	&& Gender
>  APPEND BLANK
>  REPLACE ;
>	firstname WITH lcFirstName, ;
>	lastname  WITH lcLastName, ;
>	ssn       WITH lcSSN, ;
>	dob       WITH ldDOB, ;
>	Gender    WITH lcGender
>ENDDO
>
>Has anyone run into this? Do I need to do some kind of low-level cleaning up first?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform