Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading and parsing .ODB files in Perl

Status
Not open for further replies.

Argonath

Technical User
Feb 1, 2004
10
US
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.
 
All data bases have structure but you need to do some research.
Have a look at the headers of the tables and see if you can work out the architecture.
I have never worked with ODB files so can't help you on that one. I work with DBF files but they are very easy to understand. I had to look what ODB were and doing a Google on 'ODB' is not for the faint hearted. Better to search for 'ODB database'.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top