Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Read file format .DBF

Subject: Read file format .DBF

From: G. Jandali

Date: 25 Jul, 2002 10:05:58

Message: 1 of 3

Hi All,
I am trying to read files of format ".dbf" (a Microsoft Visual FoxPro
Table). I tried all the commands available under fileformat in
MATALAB to read it but no way. Even cxlsread -a compilable version of
xlsread- could not read it! FYI, this type of files is readable with
Excel.
I don't have the privileges to generate the file with a different
format since the machine generates it.
I successfully used ActiveX, BUT since I need to compile the m file
afterwards, I have to figure out a different method than ActiveX
since it is not compilable.


Thanks in advance..
Ghanem

Subject: Read file format .DBF

From: Marcus Vinicius Eiffle Duarte

Date: 26 Jul, 2002 08:45:26

Message: 2 of 3

Maybe you could do it using the Database toolbox. There is also an
alternativa toolbox for database manipulation, also commercial, but I
don't the have the URL.
One option would be to write a simple Excel macro that would import
the DBF and export it as a WKS file (I am not sure, but I guess
wksread is compileable) or (better yet) as a CSV file. Then you would
use this file in your Matlab code.
Another way, you could also read the file using fread, what would be
rather tedious and give you some work, but the structure of a DBF
file is largely known, just search for it in Google.

Subject: Read file format .DBF

From: Chris Lawton

Date: 29 Jul, 2002 09:20:10

Message: 3 of 3

"G. Jandali" <ghanem_jandali@yahoo.com> writes:

> Hi All,
> I am trying to read files of format ".dbf" (a Microsoft Visual FoxPro
> Table). I tried all the commands available under fileformat in
> MATALAB to read it but no way. Even cxlsread -a compilable version of
> xlsread- could not read it! FYI, this type of files is readable with
> Excel.
> I don't have the privileges to generate the file with a different
> format since the machine generates it.
> I successfully used ActiveX, BUT since I need to compile the m file
> afterwards, I have to figure out a different method than ActiveX
> since it is not compilable.
>
>
> Thanks in advance..
> Ghanem

There is nothing built into MATLAB to read DBF files. However, I don't think
the file format is very complicated so you could probably use the low level
file I/O routines (FOPEN, FREAD, FCLOSE) to write a program to read your dbf
files. You can probably find a spec on www.wotsit.org.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us