×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

dbf to tab delimited proggy

dbf to tab delimited proggy

dbf to tab delimited proggy

(OP)
Hey,

Does anyone know of a program that convert dbf files to tab delimeted files? preferably run from a command line?

I have a program that reads from tab delimieted files, however it now needs to read from this dbf file. If I open the file in excel and save it as a tab delimited file it works, but I would love a command line proggy that could do this so I could automate the whole thing.

Thanks for your time.

RE: dbf to tab delimited proggy


I notice that although you've asked over 30 questions, you haven't marked any of the answers as helpful, and haven't even acknowledged most of the answers. If the answers haven't been what you're looking for, then read FAQ222-2244 carefully to find out how to ask better questions, and get the best from these forums. If the answers have solved your problems, then read FAQ222-2244 to see how to acknowledge answers properly.

For this question, why not use Excel VBA to automate the process? You can simply record a macro to do what you want. If you need more help on Excel VBA, try forum707.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller

RE: dbf to tab delimited proggy

(OP)
johnwm,

thanks for your reply. I never even knew that you were meant to mark posts as helpfull. I will read the faq and make sure I do this from now on. Thanks for the pointers.

RE: dbf to tab delimited proggy

Don't worry! There is no 'meant to'. Its entirely up to you to decide whether you find an answer valuable or not. I just wanted to see whether you were getting the right answers or not.

Its also helpful for other users of the site to see starred posts, as they then know that the answer helped somebody. As you keep using the forum, and start to answer a few questions for other people you will be very proud of your first star!

I'm glad this one helped you, and thanks for the star smile

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller

RE: dbf to tab delimited proggy

I don't know of a program that does this specifically but writing something to do it should not be too difficult

CODE

Public Sub ExportToTab(dbfFile As String, TabFile As String)
Dim con                         As New ADODB.Connection
Dim rs                          As New ADODB.Recordset
Dim fld                         As ADODB.Field
Dim TabRec                      As String
Dim nH                          As Integer

nH = FreeFile
Open TabFile For Output As #nH

con.Open "Provider=Microsoft.Jet.OLEDB.4.0" & _
         ";Data Source=" & dbfFile & _
         ";Extended Properties=dBASE IV;"

rs.CursorLocation = adUseClient
rs.CursorType = adOpenKeyset
rs.Open File, con

Do Until rs.EOF
   TabRec = ""
   For Each fld in rs.Fields
      TabRec = TabRec & fld.Value & vbTab
   Next
   TabRec = Left(TabRec, Len(TabRec) - 1)
   Print #nH, TabRec
   rs.MoveNext
Loop

Close #nH
Set rs = Nothing
Set con = Nothing

End Sub

RE: dbf to tab delimited proggy

Quote:

it should not be too difficult
It's even easier in Fox:

CODE

Use &dbfFile
Copy to &TabFile Type Delimited

Geoff Franklin
www.alvechurchdata.co.uk

RE: dbf to tab delimited proggy

I have used access to open a DBF file.  I am thinking Access has a way of exporting a comma delimited file because that is the access default for files I do believe.  I could be wrong.  Seems like it is a process of open and save as.  I dont think MS Access allows you to open DBF files by default when you click on them, but I have viewed DBF Extracts in Access many times when we exported them from the mainframe VSAM Files using Decision Technology report generator.

If you do not like my post feel free to point out your opinion or my errors.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close