Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coverting text files to .dbf

Status
Not open for further replies.

blumash

Programmer
Oct 2, 2003
50
HU
I have a text file which I have to convert to .dbf file , I don't see an option to use this file via Fox 2.6 or maybe it is a way to use it , maybe possible to convert it to .dbf some how.

Thank's
 
How is the data presented in the text file? Is it in a fixed width field presentation? Or is it in a "delimited" format?

If you show a couple records, then I'm sure someone can suggest the "best" way to do this.

Also, it's important to know if you'll be adding this data to an existing table or whether you can simply create a new table.

Rick

Hint: Check the Help file for the IMPORT and APPEND FROM commands.
 
"I have a text file which I have to convert to .dbf file"

In addition to Rick's suggestions, let us know if this is a one-time conversion or if this conversion needs to be done on a regular basis by your application.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Thank's for your answer , this is a one time conversion , the contain of the fields in the .txt file r :

Negyvenhárom
Negyvennégy
Negyvenöt
Negyvenhat
Negyvenhé

those r recoreds which I have to import their content to a .dbf file , I chec ked out IMPORT and APPEND FROM commands and none of them have the option of a .txt file.
 
blumash,
each field is separate line (CR+LF)?
You want connect each five line into one dbf record ?
(SDF is option for you...)
Tesar
 
Each line is a record in the .txt file & will be the same in the .dbf file.
 
Create a table with a field large enough for the incoming lines then:

myTxtFile="TEXT.TXT" && your file name here
APPEND FROM (myTxtFile) TYPE SDF

Probably this is all you need. If you need each line to import multiple fields for each line, then it will get a little bit more complicated. But go ahead and try this.

As always, do your experimenting in a separate test area with copied data. You don't want to make a mistake and loose your only file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top