[data,
datinfo] = dbfread (fname)
¶[data,
datinfo] = dbfread (fname, recs)
¶[data,
datinfo] = dbfread (fname, recs, cols)
¶[data,
datinfo] = dbfread (fname, recs, cols, re)
¶Read contents of a dbase (dbf) file, provisionally dbase III+, IV or V.
Arguments recs and cols need not be as long as the number of records and columns in the file, resp.; dbfread will stop reading data if any of recs or cols (if supplied) is exhausted.
Sometimes dbase files contain records indicated as being erased. The data in such records is silently skipped, unless the re flag is set and/or recs is supplied and erased records happen to be present in the requested record numbers.
Examples:
A = dbfread ("file.dbf"); (returns all data in file.dbf in array A)
[A, B] = dbfread ("file.dbf", [], ["colB"; "colF"]); (returns all data in columns named "colB" and "colF" from file.dbf in array A and information on the database build-up in struct B)
A = dbfread ("file.dbf", [0 1 0 0 1 0 0]); -or- A = dbfread ("file.dbf", [2 5]); (returns data from record numbers 2 and 5 in file.dbf in array A)
A = dbfread ("file", [0 1 0 0 1 0]); (returns data from record numbers 2 and 5 in file.dbf in array A)
[~, B] = dbfread ("file.dbf", 0); (to returns info on column names and number of records, plus more info)
[A] = dbfread ("file", [], {"Header1", "Col5"}); (returns data from columns with names (headers) Header1 and Col5, resp.)
See also: xlsread.
Package: io