Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append from text file doesn't append correctly
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01248215
Message ID:
01248228
Views:
26
>Heading should read: Append from text file does'nt append correctly
>
>I have a text file with text data in that is delimited with the pipe "|" symbol. When import this file into a cursor some of the lines are not imported incorrectly. The data is put into the wrong field positions. On closer investigation I noticed that some of these fields in the text file have double quite in them eg 14" monitor. The stange this is that this does not happend each time.
>
>I have now resorted to removing all quotes before appending the file. Is there a way to get this data into the cursor without first removing the quotes.
>
>My append statemet:
>SELECT MyCurs
>APPEND FROM V:\myfile.txt DELIMITED WITH CHARACTER |
>
>Date in the text file is something like this:
>1234|some text|01/01/2007|12.23
>1235|14" Monitor|01/01/2007|12.23
>1236|some text|01/01/2007|12.23
>1237|some text|01/01/2007|12.23
>
>Thanks in advance

This worked for me with this data sample:
CREATE CURSOR curTest (nID I, cField C(20), dField D, Amount N(12,2))
APPEND FROM test.txt DELIMITED WITH CHARACTER '|'

APPEND FROM test.txt DELIMITED WITH "" WITH CHARACTER |
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform