DBF2TXT & TXT2DBF

Česká verze

Overview

TXT2DBF.EXE and DBF2TXT.EXE are command line utilities for (batch) conversion between dBIII database format and text file format. You may find more convenient to edit database in a text form using your favourite plain-text editor. You can easily add or delete rows and columns, change width of fields, find and replace data etc. Updated text can be converted back to DBF format using TXT2DBF utility and then processed with database application or imported to a speadsheet.

License

Both utilities are available free of charge for anybody. They may be redistributed unmodified in the form of original archive only, as downloaded from www.vitsoft.info. Use at your own risk.

TXT format definition

This is a small example of a short database in text format accepted with TXT2DBF:

 |FILENAME    |FILESIZE|DATUM   |PIC|PICNAME     |DESCRIPTION         |
 |Character   |Numeric |Date    |Log|Character   |Character           |
 |          12|       7|       8|  1|          12|                  20|
 +------------+--------+--------+---+------------+--------------------+
 |CV557.ZIP   |   12472|19961112|N  |            |File description    |
 |CV373.ZIP   | 1259252|19961112|Y  |CV373.BMP   |Some other file     |
 |CV549.ZIP   | 1274600|19961112|Y  |CV549.BMP   |Another file        |
 |CV508.ZIP   |  221299|19961112|Y  |CV508.BMP   |Yet another file    |

Fields are separated with special separator character. First four lines represent database header and have special meaning:

  1. Field names.
  2. Field types: Character, Numeric, Logical, Date or Memo.
  3. Field widths. E.g. 5.2 represents format 999.99 in Numeric type.
  4. Header separator, ignored.

Some simplifications are allowed in TXT2DBF conversion:
Field type names in 2-nd line may be abbreviated to C,N,L,D,M.
Any character may be used as a separator provided that it does not occur anywhere else in data. Each line must start with a separator character. The last separator may be omitted.
Different lines may have different separators.
Data may be surrounded with spaces, these spaces are stripped off during conversion and data are aligned to the left (numeric data to the right). Spaces on the left will be not stripped off if parameter /V is used. Data exceeding the field width are trimmed.
Empty lines are ignored.
Number of fields in the first three lines must match one another. For data lines (4th and next) this rule is not that strict. Missing fields from incomplete data lines are considered to be empty. Superfluous fields in data lines are ignored.
Records marked for deleting (*) are omitted from DBF2TXT conversion.

Syntax

    DBF2TXT [parameters] input_file_name [output_file_name]
    TXT2DBF [parameters] input_file_name [output_file_name]

Default extensions are DBF and TXT. Default output file name corresponds to input file name.
Parameter /O will supress the warning query when output file already exists. This is useful in batch conversions.

Additional DBF2TXT parameters:
Text header (the first four lines) will be omitted when parameter /H is used.
Field separator can be set with parameter /Cxx, where xx is hexadecimal code of the required character. Default is /CB3 (box drawings light vertical).
Example: /C3B will use semicolon, /C7C will use vertical pipe. Be sure to choose a character which is not contained in data.

Additional TXT2DBF parameters:
When parameter /T is used, fields width in 3-rd line is ignored and real fields width is calculated from fields content (without white spaces) during an additional conversion pass.
Parameter /V tells TXT2DBF not to strip off the white spaces from the left side of data fields. This can be useful for later sorting by columns with variable data width.
With parameter /Cxxxx we can set the codepage information to DBF header (the word at offset 32). xxxx must be replaced with required hexadecimal codepage value.
When parameter /A is used, TXT2DBF will append EOF character (0x1A) at the end of database file.
Parameter /F will insert LF character (0x0A) right after the CR character (0x0D) at the end of database header. This will align payload data to a word boundary for better performance, but some dbf viewers may have problems with this modification, therefore the LF is omitted by default since version 2.20.

Example

 DBF2TXT \\Server\share\path\mydata.dbf "D:\Documents And Settings\MyName\mydata.txt"
 TXT2DBF /O /C01C8 "D:\Documents And Settings\MyName\mydata.txt"

Limitations

Field width must not exceed 255.
Maximum of 255 fields is allowed.
Total records (line) width must not exceed 4096.
Number of records is unlimited.
UNC and long file names are supported in Windows version only.

History

1.00 15.7.1994
First release.
1.20 17.3.2001
English version
1.30 11.7.2001
Disk free space check supressed.
2.00 7.3.2004
Windows version integrated with previous 16bit version into one executable.
HTML documentation is in separate files now.
Parameters /K /L /S /D are tolerated for backward compatibility but no longer supported.
Progress indication, Czech error reports and disk space check were omited.
2.01 Jul 27, 2004
Bug fixed in DBF2TXT 2.00-Win: incorrectly recognizing some dbIII formats.
2.02 Sep 1, 2005
Bug fixed in TXT2DBF 2.01-Win: false 'Syntax error on line 3' was reported when more than 8 spaces followed a number in field width specification.
2.03 Nov 4, 2005
Another bug fixed in TXT2DBF which could cause corruption of data in some circumstances.
2.10 21.10.2006
Parameters /H and /C were added for DBF2TXT.
2.20 28.10.2015
Parameters /A and /F were added for TXT2DBF.