Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HyperTerminal Sens chr(0) to capture.txt, how to stop
Message
From
15/11/2009 18:18:21
 
 
To
15/11/2009 16:12:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01434815
Message ID:
01434851
Views:
48
Hi Al:
This is something i found on the Net to get rid of pesky squares (apologies to original author who i did not note). I expanded to replace all French accents with english equivalent characters as i was experiencing spelling problems reading from a french college document ito our english dept file. the bottom command is what you are looking for i believe.

k

cFile = Filetostr("C:\sample.txt") && Read file
For i = 0 To 32 && Loop through control characters
*IF INLIST(i,10,13) && Skip Line Feed and Carriage Return
*LOOP
*ENDIF
cFile = Strtran(cFile,Chr(34),"") && Replace " ntrol Characters with Empty
cFile = Strtran(cFile,Chr(61),"") && Replace = ntrol Characters with Empty
cFile = Strtran(cFile,Chr(150),"") && Replace - ntrol Characters with Empty
cFile = Strtran(cFile,Chr(61),"") && CONVERT fRENCH
cFile = Strtran(cFile,Chr(199),"C")
cFile = Strtran(cFile,Chr(200),"E")
cFile = Strtran(cFile,Chr(201),"E")
cFile = Strtran(cFile,Chr(202),"E")
cFile = Strtran(cFile,Chr(231),"c")
cFile = Strtran(cFile,Chr(232),"e")
cFile = Strtran(cFile,Chr(233),"e")
cFile = Strtran(cFile,Chr(219),"U")
cFile = Strtran(cFile,Chr(251),"u")
cFile = Strtran(cFile,Chr(212),"O")
cFile = Strtran(cFile,Chr(194),"A")
cFile = Strtran(cFile,Chr(206),"I")



**cFile = STRTRAN(cFile,CHR(i),"") && reokace variabe i (Integer character) with empty
Endfor
= Strtofile(cFile,"C:\clean.txt") && or Convert to csv file
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform