Article View: comp.lang.perl.misc
Article #319Re: dbase IV files to comma delimited files
From: Marcus Blaha
Date: Mon, 01 Dec 1997 00:00
Date: Mon, 01 Dec 1997 00:00
58 lines
2342 bytes
2342 bytes
Akira wrote:
>
> Does anyone have a script that will take a dbase IV file and convert it to a
> comma delimited file using Perl 5??
>
> Any comments or suggestions would be welcomed.
>
> Thanx in advance
>
> Akira
Dear Akira,
try xbase.pm 1.0.7 which is available on the CPAN sites.
It reads dBase files and you get the contents of a record as a field.
This can be printed using the join function:
rough Example:
####################
push (@INC,'C:\\midosa'); #adjust it to your environment
require Xbase;
$dbf_name = '6.dbf';
$database = new Xbase;
$database->open_dbf($dbf_name);
print $database->dbf_type; # debug output
$database->dbf_stat; # debug output
$database->go_top;
while (1){
@fields = $database->get_record;
print "@fields\n"; # unformatted test output
$database->go_next;
if ($database->eof) {
last;
}
}
####################
Greetings from Bonn
Marcus
--
#################################################################
# Marcus Blaha startext Unternehmensberatung GmbH
# Kennedyallee 2 / 53175 Bonn
# Tel.: +49.228.95996-16 Fax.: +49.228.95996-66
# Compuserve 101317,3140 eMail mbl@startext.de
# WWW http://www.startext.de
#################################################################
Technical Details
Message-ID:
<34828752.7681@startext.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<65s8vd$r1d@bgtnsc03.worldnet.att.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1133f4,7c44ccc8bfa09802 X-Google-Attributes: gid1133f4,public X-Google-Thread: 10f591,7c44ccc8bfa09802 X-Google-Attributes: gid10f591,public X-Google-Thread: 10ba3c,7c44ccc8bfa09802 X-Google-Attributes: gid10ba3c,public X-Google-Thread: fa0ae,7c44ccc8bfa09802 X-Google-Attributes: gidfa0ae,public X-Google-Thread: 112333,7c44ccc8bfa09802 X-Google-Attributes: gid112333,public X-Google-Thread: f72c1,7c44ccc8bfa09802 X-Google-Attributes: gidf72c1,public From: Marcus Blaha <mbl@startext.de> Subject: Re: dbase IV files to comma delimited files Date: 1997/12/01 Message-ID: <34828752.7681@startext.de> X-Deja-AN: 294147863 References: <65s8vd$r1d@bgtnsc03.worldnet.att.net> To: Akira <j.a.d.@worldnet.att.net> Organization: startext GmbH Reply-To: mbl@startext.de Newsgroups: comp.lang.perl.misc,comp.lang.perl.modules,comp.lang.perl.tk,de.comp.lang.perl,fr.comp.lang.perl,pl.comp.lang.perl