Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Tore Bleken
  Where is Tore Bleken?
 Stokke
 Norway
 Tore Bleken
 To: Ahsan Rana
  Where is Ahsan Rana?
 Lahore
 Pakistan
 Ahsan Rana
 Tags
Subject: RE: Text File to DBF
Thread ID: 394056 Message ID: 394067 # Views: 38 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Monday, December 30, 2013 11:32:27 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.
> >
> > There's a fine line between helping and adding to the confusion.
> >
> > How to create sample data
>
> OK Thanks. text file is appending now but there is a hexedit window which close manually and i want to run it in EXE. How i can do that.
>
> Rgds:
> Ahsan Rana

The Hexedit lines I showed you, shouldn't be a part of your program. I only showed them so that you (and others who watch this thread) can see how to inspect any file.

There's a fine line between helping and adding to the confusion.

How to create sample data

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