Main  History  Search  Repository tree

[BACK] Return to convert.pl CVS log [TXT][DIR] Up to [CVSROOT] / PappusArabus

File: [CVSROOT] / PappusArabus / convert.pl  (download) - view tree
Revision 1.1.1.1 (vendor branch), Wed Mar 19 21:05:32 2003 UTC (10 years, 2 months ago) by mjschief
Branch: mjschief, MAIN
CVS Tags: v1, HEAD
Changes since 1.1: +0 -0 lines
Imported PappusArabus module


#!/usr/bin/perl

while (<>) {

chomp;
($ref, $text) = split (/\t/);

if ($text) {

($chap, $xxx, $par, $s) = split (/\|/, $ref);

$chap+=0;
$par+=0;
$s+=0;

$ref=~s/\|/./g;
$ref="id.$ref";


if ($chap != $oldchap) {

$work.="</p></chap>\n<chap n=\"$chap\"><p type=\"head\"><s id=\"$ref\">$text </s>";
$oldchap=$chap;
$oldpar=$par;

} elsif ($par != $oldpar) {

$work.="</p>\n<p><s id=\"$ref\">$text </s>";

$oldpar=$par;

} else {


$work.="<s id=\"$ref\">$text </s>";


}

}

}

$head = "<chap n=\"0\"><p>";
$tail ="</p></chap>";
print "$head$work$tail";