Anlegen einer CDB-Datenbank III

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]

makebookcdb.pl
#!/usr/local/bin/perl

use strict;
use warnings;
use TextRecordConverter;

my $cmdname = $0; $cmdname =~ s{.*/}{};

my $key = 'isbn';
my $inconv = new TextRecordConverter
   fieldnames => [qw(isbn author title)],
   fieldsep => ':', escape => '%';
my $outconv = new TextRecordConverter
   fieldnames => [qw(author title)],
   fieldsep => ':', escape => '%';

while (<>) {
   chomp;
   my $line = $_;
   my $record = $inconv->line_to_record($line);
   my $contents = $outconv->record_to_line($record);
   my $key = $record->{$key};
   print "+", length($key), ",", length($contents), ":",
      $key, "->", $contents, "\n";
}
print "\n";

 [Vorheriges Kapitel]  [Vorherige Seite]  [Inhaltsverzeichnis]  [Nächste Seite]  [Nächstes Kapitel]
Copyright © 1996 - 2003 Andreas Borchert, in HTML konvertiert am 01.10.2003