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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting CSV and DBF file into text file format

Status
Not open for further replies.

33216CLC

Programmer
Aug 17, 2000
173
BS
I am creating an import procedure and would like to open and read data from a dbf or csv file and then convert it to text file format. I am familiar with writing code for imports from text files but not from csv or dbf file. What is the quickest and simplest way for me to do this?

Thanks,

Cooleen
[sig][/sig]
 
I know there is a DOS utility for converting dbf files to text files (possibly to csv files), but I cannot remember what it is called - maybe you could search it out - but I will look into it.
Whenever I have had to convert csv files to text I have done it through Excel.

Simon [sig][/sig]
 
Sorry Coleen, I didn't fully read your post!!!
If you have written import routines for text files, then you can treat csv files in exactly the same way.
As for dbf files, link to them in Access and then you can treat them in the same way as normal Access tables, so you can run sql append queries on Access tables selecting data from the linked foxpro tables.

Simon [sig][/sig]
 
Thank you, Simon. The dbf file in question was opened in excel and then either exported or imported earlier yesterday. I agree that this is what will need to be done. However, I would like to minimize the amount of seperate programs used to get the final file format (text). Here is the scenario:

An IdCard software (database is in .dbf format) has employee information that needs to be imported into a Time and Attendance software (.imp or text format). I am writing a small executable program to assist in this process. I would like for the user to be able to convert the dbf file to Access from within my program, then export in text format.

Cooleen

[sig][/sig]
 
Cooleen,

Are you retaining ".dbf" file information within the database, or just sending it out as a text file? If you are just sending it on it's merry way, then there is no reason the 'convert it' to Ms. Access.

[sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
 
You don't need to do any conversion of the file - as previously posted, just link to it in Access and then you can process the table in VB as you would with a normal Access table.

Simon [sig][/sig]
 
Thanks Michael and Simon,

I guess what I really what like to know is if I can link to the file to the dbf file in access using code in VB. This would prevent having to literally open Access. Is this at all possible in VB?

Cooleen [sig][/sig]
 
Open Access once. Link to the dbf file ONCE and then you can read the data as often or as little as you like from VB. ONCE YOU HAVE LINKED TO THE DBF, YOU DO NOT NEED TO KEEP OPENING ACCESS, YOU CAN DO IT ALL FROM VB.

Simon [sig][/sig]
 
Thank you Simon for clearing that up for me.

Peace,

Cooleen [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top