Export all tables data to CSV, JSON, XML, etc

Hi Bostjan,

1
Another way to convert .DAT files is by using the tool included in Clarion 2.1 called The Clarion Converter CCVT.EXE

Of which you can see a screenshot here.


It asks for the input and output file format and their names. The Source File (with a File Definition) is only requested if the output is in Clarion format.

Formats other than Clarion .DAT are DBase II & III, DIF (Data Interchange Format) and BASIC (CSV).

It can be used interactively or by command line. Interactively you can access the help with F1 that shows the following:

2
By command line the discovered syntax is the following:

CCVT.EXE InputFormat InputFile OutputFormat OutputFile SourceFile InputOwner

For example you can call it as:

CCVT Clarion MyFile.DAT Basic MyFile.CSV

Or if your file has an OWNER attribute

CCVT Clarion MyFile.DAT Basic MyFile.CSV Dummy MyOwner

3
This utility is 16 bit so it will not run natively on 64 bit Windows. You can use it through emulators like VDos or DOSBOX and derivations, although it will run slower.

4
Being called from the command line means you can automate it for all files in a directory with FOR. It even has an option to recursively traverse directories.

For example, in the case of 4DOS in VDosPlus:

FOR %datfile IN (*.DAT) DO CCVT Clarion %datfile BASIC %@LEFT[-4,%datfile].CSV

%datfile gets filled with the name of the current File (eg. MyFile.DAT) and %@LEFT[-4,%datfile] is a special syntax to remove the last four characters (.DAT extension) to be able to pass with the new extension .CSV

The syntax for CMD.exe would be different.

You would see the Converter window working automatically showing the record counter, and flickering on each different file, as it returns to DOS and run CCVT again with the next file.

2 Likes