Skip to main content

DotDBF: DBF Tool

The DotHRB DotDBF executable is a command-line tool for direct management, inspection, and manipulation of DBF files. It supports command execution via JSON input and direct command options.

Important

Currently, DotDBF exclusively supports DBFCDX with CDX production indexes. Support for additional DBF drivers and index schemas will be evaluated and introduced in future releases based on community demand and user feedback.

Usage Syntax

dotdbf [options]

1. ⚙️ Core Options and Configuration

These options control output, logging, connection, and file operations.

OptionDescription
-h / -helpDisplay the help documentation.
-vEnable Verbose output.
-o <file>Set the output file path for results.
-dbs <json|file>Set dotdbs connection parameters (used for remote operations).
-t <table.dbf>Set the default DBF table to be used for subsequent commands.
--licenseDisplay license and copyright information.
--versionDisplay the tool version.

2. 📊 Data Query and Structure Options

These options are used to inspect the DBF file or define data retrieval criteria.

OptionDescription
-modelCreate a model file (e.g., Test.json) from the DBF structure in the Models directory.
-struList the DBF structure (field names, types, etc.).
-list ["params"]List records based on query parameters. Syntax: "[field, ...] <where clause> [bool expr.]"
-count <all|n>Set the maximum number of records to list (n is the count, or all).
-order <ordname>Set a specific index order to use for listing records.
-scope <top,bot>Set the record scope using string boundary values (e.g., "A,Z").
-fields <f1,...>Set the specific fields to display in the output list.
-where <clause>Set the SQL-style WHERE condition to filter records.
-deletedInclude deleted records in the result set.
-no-prettyOutput results as unformatted JSON (no pretty printing).

3. 📊 Faker Options (requires npm "@faker-js/faker installed)

OptionDescription
-faker-setSet faker params.
-faker-outCreates the "Table".faker.json file.
-faker-runRun the faker script and update the "Table"

4. ⌨️ Commands History

These commands are used for managing the command history.

CommandDescription
:List the history of log entries (previous commands).
:? <search>List log entries that contain the specified <search> string.
:<n>Recall and execute log entry number <n>.
:$Recall and execute the last log entry.
:@<template>Recall a template** (e.g., @select).

5. 📝 Practical Examples

ScenarioCommandResult
Create Model Filedotdbf -t test.dbf -modelCreates the Test.json model file in the Models directory.
Output the create jsondotdbf test.dbfOutput the "create using json" to recreate the test.dbf and the indexes.
Quick List Recordsdotdbf -list test.dbfLists the structure and all rows of test.dbf as a json.
Filtered Listdotdbf -list "first, last, zip where zip = '12345'" test.dbfLists first, last, zip where zip equals '12345'.
Execute Command Filedotdbf mydbsetup.jsonExecutes the set of commands defined within the mydbsetup.json file.
Export to Spreadsheetdotdbf -o test.xlsx test.dbfCreates an Excel spreadsheet (test.xlsx) from the DBF data and opens it automatically.
Remote DB Accessdotdbf -dbs "dbs.json" -u net:test.dbf :@selectConnects to the dotdbs server using connection parameters in dbs.json, sets the remote table, and runs a stored select template.