View & convert dbf, dBase and xBase files to text, SDF and HTML tables.
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
Custom Versions of PeekDBF Pro
peekdbfpro [ -a | -s[t] | -c[STR] | -q[STR] | -h[STR] ] [-xSTR] [-m] file.dbf
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
Please read the README file
See the PeekDBF Pro User's Manual.
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.
everything, including records marked for deletion, use the
peekdbf -a file.dbf
Since the output goes to the screen, use something like
peekdbfpro -a file.dbf | more
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).
-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 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
peekdbfpro -c file.dbf > output.txt
-moption 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
-ssets 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
-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
-m option is included (see below).
General fields are converted to gen.
The only attributes are
in the table-tag:
<TABLE BORDER CELLPADDING="5">
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
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.
PeekDBF Professional can extract the contents of memo fields along with,
or separately from (see
-x below), the other fields.
-m option must be used with one of
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
-m works differently with
Every EOL causes a
<BR> to be inserted into the HTML.
This attempts to retain the text flow in the original memo.
-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.
-xSTR option must be used with one of
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.
PeekDBF only read files. It never alters them in any way. Back up important files often.
Copyright © 1994-2000 by P.J. LaBrocca. All rights reserved.
PeekDBF is a trademark of P.J. LaBrocca.