$1<\/q>/g;
return $t;
}
foreach $line (@data) {
if ($line =~ /(\d+),(\d+),(\d+),(\d+),(.*)/) {
$ord = $1;
$nBook = $2;
$nChap = $3;
$vers = $4;
$text = $5;
$text = processText($text);
$oBook = @OSISbook[$nBook-1];
if ($oBook eq "") {
print "Error unknown book: $book\n";
}
$text =~ s/\s*$//g;
if ($book ne $nBook) {
if ($book ne "") {
print OUTF "<\/chapter>\n";
$chap = "";
print OUTF "<\/div>\n";
}
print OUTF "\n";
}
if ($chap ne $nChap) {
if ($chap ne "") {
print OUTF "<\/chapter>\n";
}
print OUTF "\n";
}
print OUTF "$text<\/verse>\n";
$book = $nBook;
$chap = $nChap;
}
}
print OUTF "<\/chapter>\n";
print OUTF "<\/div>\n";
print OUTF "<\/osisText>\n";
print OUTF "<\/osis>\n";
close (OUTF);