Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Michael Johnson
  
 
 
 Michael Johnson
 To: Tore Bleken
  Where is Tore Bleken?
 Stokke
 Norway
 Tore Bleken
 Tags
Subject: RE: Text File to DBF
Thread ID: 394056 Message ID: 394066 # Views: 38 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Monday, December 30, 2013 11:31:53 AM         
   


> Your problem is that the text file clearly is a double byte file. I found out this by using the tool HexEdit.app which comes with VFP.
>
> 
> lcFile = 'Attend.txt'
> Do Addbs(Home()) + [tools\hexedit\hexedit.app] With lcFile

> You can fix this easily.
>
> 
> strtofile(chrtran(filetostr('Attend.txt'),chr(0),''),'Attend.txt')
> APPEND FROM Attend.txt TYPE DELIMITED WITH TAB

> One line of caution. You use Name and DateTime as field name. These are reserved words, and may cause strange errors. I suggest for instead AttName and AttDT instead.


Create Cursor MyTable (nNo N(4), nTMNo N(4), nEnNo N(4), Name C(10), GMNo N(4), Mode N(4), tDateTime T)

=Strtofile(Chrtran(Filetostr('Attend.txt'), Chr(0),''), 'Attend1.txt')
Append From Attend1.txt Type Delimited With Tab For nTMNo > 0

Go Top
Browse



- Tuberose
.

ENTIRE THREAD

Text File to DBF Posted by Ahsan Rana @ 12/30/2013 9:32:42 AM
RE: Text File to DBF Posted by Tore Bleken @ 12/30/2013 9:42:58 AM
RE: Text File to DBF Posted by Stefan Wuebbe @ 12/30/2013 9:49:35 AM
RE: Text File to DBF Posted by Ahsan Rana @ 12/30/2013 10:26:52 AM
RE: Text File to DBF Posted by Stefan Wuebbe @ 12/30/2013 10:48:36 AM
RE: Text File to DBF Posted by Ahsan Rana @ 12/30/2013 11:18:55 AM
RE: Text File to DBF Posted by Tore Bleken @ 12/30/2013 11:12:01 AM
RE: Text File to DBF Posted by Ahsan Rana @ 12/30/2013 11:27:29 AM
RE: Text File to DBF Posted by Tore Bleken @ 12/30/2013 11:32:27 AM
RE: Text File to DBF Posted by michael johnson @ 12/30/2013 11:31:53 AM
RE: Text File to DBF Posted by Cetin Basoz @ 12/30/2013 12:23:48 PM
RE: Text File to DBF Posted by Tore Bleken @ 12/30/2013 1:35:57 PM
RE: Text File to DBF Posted by Cetin Basoz @ 12/30/2013 6:58:53 PM