Board index » delphi » copying dbf files into csv delimited files

copying dbf files into csv delimited files

Hi,
When using visual dbase I would use the
copy to filename ALL DELIMITED
command to make a dbase file into a csv file,
can anyone recomend a procedure, and if possible some sample code that could
help me do this in Delphi 4,
any help is much appreciated,

Thank You
George

 

Re:copying dbf files into csv delimited files


Quote
"George Feinberg" <georgesL...@hotmail.com> wrote:
>When using visual dbase I would use the
>copy to filename ALL DELIMITED
>command to make a dbase file into a csv file,
>can anyone recomend a procedure, and if possible some sample code that could

RxLib demo application DbExpl32 (w/- source) can do this. See procedure
ExportDataSet in BdeUtils.pas.

Declaration
===========
procedure ExportDataSet(Source: TBDEDataSet; DestTable: TTable;
TableType: TTableType; const AsciiCharSet: string; AsciiDelimited:
Boolean; MaxRecordCount: Longint);
Description
===========
Exports table Source into DestTable. The latter type is TableType
(defined in DBTABLES.PAS as TTableType = (ttDefault, ttParadox, ttDBase,
ttFoxPro, ttASCII) ).

If TableType if ttASCII, you can define an Ascii characters set in
AsciiCharSet (if empty "ascii" standard is used).

If AsciiDelimited is true (ttASCII only), resulting file is delimited.

MaxRecordCount allows to export the begining of Source.

To get control over more parameters, use ExportDataSetEx

Regards,
Chris Roberts

Re:copying dbf files into csv delimited files


You can use the BatchMove component and the BDE ASCII driver. The best
documentation for the ASCII driver is in the file ASCIIDRV.TXT in the Delphi
1 directory on your Delphi CD.

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to questions received via email)

Re:copying dbf files into csv delimited files


Quote
"Bill Todd" <b...@nospam.dbginc.com> wrote:
>You can use the BatchMove component and the BDE ASCII driver. The best
>documentation for the ASCII driver is in the file ASCIIDRV.TXT in the Delphi
>1 directory on your Delphi CD.

ExportDataSet in RxLib uses the BDE ASCII driver, but you don't have to
do all the hard work of setting up the schema file :-)

Regards,
Chris Roberts

Other Threads