Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with importing tab delimited file
Message
From
07/04/2010 14:24:37
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01458761
Message ID:
01459228
Views:
40
PMFJI, but VFP ships with a nice little Hex Editor
Do (Home(1)+'tools\hexedit\hexedit.app')
>Well, I swear I've used tab delimited just fine before, which is what's puzzled me about this particular file. I may have to take a look at it with a low-level tool to see if there's a character embedded that Word & VFP don't see. In any case, it did work to pull the file into a memo field, do a strtran for two tabs in a row, inserting a "0" in between them, then dumping the file back out. With that, it imports just fine and I just ignore the zeroes in the pertinent fields. So, I'm good to go until I get the next one from the client that has something else strange :-)
>
>Yes, I agree, your file and the one I have should both work fine. go figure.
>
>Thanks!
>
>>Works fine for me in a simple test below. What is different in your case?
>>
>>#DEFINE ccTAB CHR(9)
>>
>>CREATE CURSOR Test (pk i, cf1 C(10), cf2 C(10), cf3 C(10), cf4 C(10), cf5 C(10))
>>
>>TEXT TO lcStr TEXTMERGE NOSHOW
>>1<<ccTAB>>11<<ccTAB>>12<<ccTAB>>13<<ccTAB>>14<<ccTAB>>15 
>>2<<ccTAB>>21<<ccTAB>>22<<ccTAB>>23<<ccTAB>>24<<ccTAB>>25 
>>3<<ccTAB>>31<<ccTAB>><<ccTAB>>33<<ccTAB>><<ccTAB>>35 
>>4<<ccTAB>>41<<ccTAB>><<ccTAB>><<ccTAB>><<ccTAB>>45 
>>ENDTEXT
>>
>>lcFile = "Temp.txt"
>>STRTOFILE(lcStr, lcFile)
>>
>>APPEND FROM (lcFile) TYPE DELIMITED WITH TAB
>>
>>
>>>Has anyone run into a problem with VFP "skipping" empty tab-delimited fields when using an append from command? I have a file where just a few records are not importing properly and see that the file has three empty tabs in a row and VFP simply moves to the next populated field and starts populating away from there!
>>>
>>>There is another instance in the file where there are three similar blank fields (toward the end of a record) and it imports just fine with empty fields. I've looked at the file with the "show whitespace" and also with Word in show formatting codes mode. I see no difference in the file points that work with the ones that dont.
>>>
>>>I suppose I can scan down the file looking for two simultaneous tabs, inserting a space between them (hopefully that will work), but seems like such an obvious thing that should just work.
>>>
>>>Has anyone else run into this problem?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform