Can a script be written to read and parse .ODB files in Perl that is independent of the DBI? Before I realized that Perl had a DBI specifically for this purpose I was working on a script to read an .odb file:
-----------------------------------------------------------
#!/usr/local/bin/perl/perl -w -I/usr/local/lib/perl5
#this open command reads the .odb file from a CD-ROM
open(INFILE,'E:\TESTFILE.ODB') || die("Could not open file!");
open(OUTFILE,"+>outfile");
# this section reads the data in the .odb file
binmode(INFILE);
binmode(OUTFILE);
while ($len=sysread(INFILE,$buf,2048))
{
if (ord($buf)){
$convert_from_ascii=ord($buf);
print $convert_from_ascii," ";
} else {
print $buf,"\n";
}}
close(INFILE);
close(OUTFILE);
-----------------------------------------------------------
NOTE: This script does read and display the contents of the MS Access-generated .ODB file but contains no output formatting statements. As a result, text and ASCII file data is displayed but ANSI-based characters (smiley faces, diamonds, etc.) are left untranslated.
What is the best way to accomplish this task (what are the best commands/scripts used to read and parse .odb files both with and without using the DBI)? Thanks in advance for your help/advice.
-----------------------------------------------------------
#!/usr/local/bin/perl/perl -w -I/usr/local/lib/perl5
#this open command reads the .odb file from a CD-ROM
open(INFILE,'E:\TESTFILE.ODB') || die("Could not open file!");
open(OUTFILE,"+>outfile");
# this section reads the data in the .odb file
binmode(INFILE);
binmode(OUTFILE);
while ($len=sysread(INFILE,$buf,2048))
{
if (ord($buf)){
$convert_from_ascii=ord($buf);
print $convert_from_ascii," ";
} else {
print $buf,"\n";
}}
close(INFILE);
close(OUTFILE);
-----------------------------------------------------------
NOTE: This script does read and display the contents of the MS Access-generated .ODB file but contains no output formatting statements. As a result, text and ASCII file data is displayed but ANSI-based characters (smiley faces, diamonds, etc.) are left untranslated.
What is the best way to accomplish this task (what are the best commands/scripts used to read and parse .odb files both with and without using the DBI)? Thanks in advance for your help/advice.