Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ascii Characters in a field

Status
Not open for further replies.

ladyhawkfl

Technical User
Jan 31, 2005
9
US
I am attempting to remove Ascii bar characters from a name field and have not been successful. The file was exported from Access into DBIII format and contains the ASCII bar characters for a TAB.

Any suggestions would be very much appreciated.

Pam
 
I'm not sure what an ASCII bar character is, but TAB is chr(9), and you could eliminate it with:
Code:
REPLACE mytable.name with CHRTRAN(mytable.name ,CHR(9),"")
Rick
 
Pam,

I am not sure which ASCII Character is making you life difficult, suppose however you know the ASCII(number) of the character to be replaced with the ASCII(number). In this case suggest you scan your table and remove the unwanted charcters using the STRTRAN() function.

Hope this answers your question.

Koen
 
Thanks, but it didn't work! I have tried every ASCII conversion code that I can think of and none work.

Thanks for the idea!
 
Pam,
If you have a hex file viewer, you could go in and look at the data to find out what characters are actually in that field. VFP has always had a free one included - HexEdit.

Try:
Code:
DO HOME()+"setup\tools\hexedit\hexedit" && 9.0
* or
DO HOME()+"tools\hexedit\hexedit" && VFP 5.0->8.0
Rick
 
Pam,

I believe you donot know which character is your asci bar. So 1st to determine which one to be replaced with something or eventualy nothing, Copy paste a record with this character and run following code:
Code:
Para Char2Find
For Y=1 TO LEN(Char2Find)
	? TRAN(y)+SPAC(3)+SUBS(Char2Find,y,1)+"="+PADL(TRAN(ASC(SUBS(Char2Find,y,1))),4)
Endfor
After you have localized the problem records can be cleaned by means of STRTRAN() function.

Hope this solves your situation.

Regards,
Koen
 
Thanks to all who replied! Ultimately, I was able to solve the dilemma - It was ASCII code 127 / Hex 7F that was causing all my problems!

Thanks again!
Pam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top