View & convert dbf, dBase and xBase files to text, SDF and HTML tables.

PeekDBF Professional

PeekDBFTM Professional - dBASE/xBase File Viewer and Converter - Version 2.0
Copyright ©1994-2000 P.J. LaBrocca. All rights reserved.

For Windows 95/98/NT/2000
New! Linux (Intel)

PeekDBF Pro User's Manual
Version History
Custom Versions of PeekDBF Pro
To Order

Command Line Summary

peekdbfpro [ -a | -s[t] | -c[STR] | -q[STR] | -h[STR] ] [-xSTR] [-m] file.dbf
All--Display everything.
SDF--Standard Data Format
t: text only fields
CSV--Comma Separated Values.
STR: Output field separator. Default ,
CSV--Quoted Comma Separated Values.
STR: Output field separator. Default ,
One field name, value per line.
STR: Output field separator. Default ,
HTML Table.
STR: RecordsPerTable,BaseOutputFileName.
     Default: All in one table, standard output.
Extract and rearrange fields.
STR: Comma separated list of fields. Required.
Memo--Convert memos.
File to be viewed or converted.

New Features

Standard Features

PeekDBF Professional?

PeekDBF Pro allows you to peek into industry standard dbf files to view and convert their contents. You don't need the application that created the file.

PeekDBF Pro is a Windows 95/98/NT console application. It works with any file that conforms to the dBASE/xBase 'standard' table format. It also recognizes modifications introduced by Visual FoxPro.

The PeekDBF Pro has been tested with DBFs from

and DBFs generated by a C program using the Sequiter CodeBase library of dBASE/xBase functions. Tables exported from applications that use another database programs, such as Microsoft Access and Microsoft Works, also work.

Please read the README file


See the PeekDBF Pro User's Manual.

Quick Start

Back up important files often! PeekDBF Pro only reads files, it never alters them.

Read the README file.

Please read the PeekDBF Professional User's Manual for more information about interpreting the output from PeekDBF Pro.

The default action of PeekDBF Pro is to display the header information.

peekdbf file.dbf

To see everything, including records marked for deletion, use the -a option

peekdbf -a file.dbf

Since the output goes to the screen, use something like

peekdbfpro -a file.dbf | more
to display the output a screen full at a time, or (better and recommended)
peekdbfpro -a file.dbf > output.txt

to save the output to a file that you can view at your leisure. It help to view PeekDBF Pro's output in an editor that does not wrap long lines.

-a displays the following fields types as a series of hex bytes enclosed in angle brackets: Y, T, B, I, M, G, and M (binary).

Converting DBF Files


Use the -s option to convert a dbf file to system data format, SDF.

peekdbfpro -s file.dbf > output.txt

SDF uses fixed width fields without separators; records are separated by newlines. The following field types are displayed in strings starting with <, followed by the field's one letter identifier, padded with !s and ending with > such that the string is the same length as the field type: Y, T, B, I, M, G, and M (binary). This allows convenient indexing into each record.

peekdbfpro -st file.dbf > output.txt

Adding a t to the s option limits the output to the text only fields, which probably makes more sense.

-c[STR], -q[STR], -r[STR]

The -c option produces comma delimited fields with records separated by newlines (CRLF pair). -q works exactly like -c with the addition of quotation marks. -r works like -c except each output line consists of a field-name/value pair terminated by CRLF; a blank line separates records.

peekdbfpro -c file.dbf > output.txt
This form is useful as input to programs like Awk and Perl. Memo fields are converted to the string memo, unless the -m option is included (see below). General fields are converted to the string gen. Empty fields produce a comma which works as expected with programs that count field delimiters (like Awk and Perl). The delimiter does not have to be a comma. Adding a string to -s sets that string as the delimiter. To separate fields with two stars use

peekdbfpro -c** file.dbf > output.txt

To include blanks in your delimiter use quotation marks.

peekdbfpro -c"*: :*" file.dbf > output.txt


peekdbfpro -c" " file.dbf > output.txt

HTML Tables

The -h option converts a dbf into an HTML table. The output is a complete Web page. The tags are neatly indented to make it easier to edit. The first row contains the field names. Blank fields have a dash inserted. Memo fields are converted to memo unless the -m option is included (see below). General fields are converted to gen. The only attributes are in the table-tag:


Use a line like

peekdbf -h file.dbf > mytable.html

This line is adequate for small databases. Browsers have built-in limits to the size and complexity of the tables they can handle. If your table exceeds these limits, you get bizarre results. I have produced broken tables in Netscape Navigator and Microsoft Internet Explore. The solution is to break you database up into tables spread across multiple, linked Web pages. PeekDBF Professional does that for you automatically.

peekdbf -h5,test file.dbf

The string 5,test says to put five records per page, and use 'test' as the base name for the set of Web pages. The pages are named test1.html, test2.html and so on. Each page is numbered (top and bottom) 1 of n, 2 of n, where n is the total number of pages. Each page has a fully linked navigator consisting of First, Previous, Next and Last links. The field names are listed at the top of the table and after every tenth record (so your readers know what they are looking at).

You should be careful when deciding how many records to put on each page. For records with many fields, put fewer records per page. Also take into account that big pages take longer to download. PeekDBF will happily put your 2 meg database on one Web page, but your browser probably won't format it correctly and it'll take too long to download.

Memo Fields


PeekDBF Professional can extract the contents of memo fields along with, or separately from (see -x below), the other fields. The -m option must be used with one of -c, -q, -r or -h.

peekdbf -c -m file.dbfoutput.txt

The line above creates a file with all of a record's fields, including the full contents of the memo fields, on one line, with each field separated by a comma.

The content of a memo field is extracted byte by byte, except for end of line markers (EOL). These are converted to \n to indicate that somebody pressed the the enter (return) key. (The EOLs that I've seen in memo files have been CRLF and LF, which correspond to the conventions in DOS/Windows and Linux/Unix, respectively. Macintosh uses CR, but I have not seen one in a memo yet. In any case, PeekDBF converts all of them to \n.)

Note that there is a potential problem with the line above. If the memo contains commas, it becomes difficult to process the line. In that case, use a string with -c.


-m works differently with -h. Every EOL causes a <BR> to be inserted into the HTML. This attempts to retain the text flow in the original memo.

Rearranging and Specifying Fields


-xSTR allows you to specify which fields you want in the output and the order in which they should appear. You can even repeat fields. STR is a comma separated list of fields that should be output. They are output in the order listed. The -xSTR option must be used with one of -s -c, -q, -r or -h.

peekdbf -c -x3,10,2,3 file.dbfoutput.txt

This line outputs the third, tenth, second and third (again) fields in a comma separated line.

Known Issues

To do.

PeekDBF only read files. It never alters them in any way. Back up important files often.


HTML tutorial, tags, element, examples, samples, links, www, markup, attributes, browsers, frames, forms, cgi, tables, javascript, color, calculator, reference, writing

Copyright © 1994-2000 by P.J. LaBrocca. All rights reserved.
PeekDBF is a trademark of P.J. LaBrocca.