Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I can't remove a garbage from a file
Message
 
To
17/02/2005 16:22:15
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows '98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00988090
Message ID:
00988131
Views:
48
This message has been marked as the solution to the initial question of the thread.
Byron,
This is not just "i," string :o)))

It contains a nine non printable chars, You must do the following:
MyFileAsString = FILETOSTR("D:\switch\from\2005Ch041119.001")
mybadChars      = CHR(161)+CHR(7)+CHR(130)+CHR(5)+CHR(3)+CHR(26)+CHR(16)+CHR(3)+CHR(2)  && You can see the with some HexEditor or Viewer
STRTOFILE(STRTRAN(MyFileAsString, mybadChars, SPACE(9), "Ch041119.new")
but If You Want to remove ALL non printable chars the best way is
MyFileAsString = FILETOSTR("D:\switch\from\2005Ch041119.001")

FOR myC = 0  TO 31 && All Non printable Chars
    MyFileAsString = CHRTRAN(MyFileAsString, CHR(myC)," ")
NEXT
this will leave You some chars as CHR(161) and CHR(130) and will remove CRLF - CHR(13)+CHR(10), but I am sure You will manage this :o)))

I hope this will helps You.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform