2002-02-02 04:47:19 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
#
|
|
|
|
#Converts txt files into docbook.
|
|
|
|
#
|
2002-05-01 17:59:52 +00:00
|
|
|
$VERION = '0.2';
|
|
|
|
|
2002-04-06 13:13:21 +00:00
|
|
|
use Wt2Db;
|
|
|
|
$WT2DB = new Wt2Db;
|
2002-02-02 04:47:19 +00:00
|
|
|
|
2002-04-06 13:13:21 +00:00
|
|
|
my $txtfile = '';
|
|
|
|
my $dbfile = '';
|
|
|
|
my $verbose = 0;
|
|
|
|
my $error = 0;
|
2002-02-02 04:47:19 +00:00
|
|
|
|
|
|
|
# read in cmd-line arguments
|
|
|
|
#
|
|
|
|
while (1) {
|
|
|
|
if($ARGV[0] eq "-o" or $ARGV[0] eq "--output-to") {
|
|
|
|
shift(@ARGV);
|
|
|
|
$dbfile = $ARGV[0];
|
|
|
|
shift(@ARGV);
|
|
|
|
} elsif($ARGV[0] eq "-h" or $ARGV[0] eq "--help") {
|
2002-04-06 13:13:21 +00:00
|
|
|
$WT2DB->Usage();
|
2002-02-02 04:47:19 +00:00
|
|
|
} elsif($ARGV[0] eq "-v" or $ARGV[0] eq "--verbose") {
|
|
|
|
$verbose++;
|
|
|
|
shift(@ARGV);
|
|
|
|
} else {
|
|
|
|
$txtfile = $ARGV[0];
|
|
|
|
shift(@ARGV);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($ARGV[0] eq '') {
|
|
|
|
last;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-06 13:13:21 +00:00
|
|
|
$WT2DB->ProcessFile($txtfile, $dbfile, $verbose);
|