Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I append from delimited file
Message
From
16/10/2003 20:21:59
 
 
To
16/10/2003 19:34:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00839564
Message ID:
00839581
Views:
16
>>Are the weird characters always the same? And what are they? And would they ever be in the actual data?
>>
>>You could fix the file as a whole - let's say the characters are all Chr(255) and chr(255) wouldn't ever be real data
>>
>>
StrToFile(StrTran(FileToStr("weird_file.txt"), Chr(255)),"weird_file_clean.txt")
>>[i'd actually put it to a cleaned file and use that, to be on the safe side, and follow up with the client if necessary]
>>
>VFP does not recognize these characters. When the export file is open in VFP with MODI COMM, they appear as little squares.
>
>>>TIA
>>>
>>>Ed

most likely they are Chr(0), but to be sure i'd do this - it's a little bit of a PITA, but you'll only need to do it once, hopefully, then you can clean like i mentioned before :)

Sometimes you can copy individual chars and use
? Asc(_cliptext)
to determine which chars are used, but I've often had to resort to something as ugly as
Active Window "debug output"
** get the first line - assuming ending with Chr(13)
lcFileString=FileToStr("weird_file.txt")
lcTest=Left(lcFileString, At(Chr(13), lcFileString)-1)
For ji = 1 to Len(lcTest)
  Debugout Substr(lcTest,ji,1)+" "+Transform(Asc(Substr(lcTest,ji,1)))
Next
to find these things. I've noticed that for Chr(0), you won't see either the box or the 0 in the debug window, but that's the only chr() value i've noticed that for. So if you don't see anything for that char, it's chr(0). :)

hth
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform