#!/usr/bin/perl my @files=`ls -1 *.abw`; my @ident=`cat books`; foreach (@files){ my @lines; chop; open USFM, ">>$_.usfm"; chomp(@lines=`cat $_`); @lines[1]="\\id @ident[$_-1] "; foreach (@lines) { s///; s/props\=\".*?\"//g; s/(.*?)<\/c><\/p>/\n\\c\ $1\ \n\\v\ 1\ \ /g; s/Psalm\ (.*?)<\/c><\/p>/\n\\c\ $1\n\\s1\ Psalm\ $1\n/g; s/(.*?)<\/c>/\n\\v\ $1\ \ /g; s//\n\\mt\ /g; s//\n\\imt\n\\ip\ /g; s/(.*?)<\/p>/\n\\s2\ $1\n\\p/g; s/(.*?)<\/p>/\n\\r\ $1\n\\p/g; s/

/\\f\*\ /g; s/type=\"footnote_anchor\"\ style=\"\"\ xid=\".*?\"\ >//g; s/\\r\ Kapitel/\\mr Kapitel/g; if (!(/\\f.*?\[.*?\\f\*/)) { s/\[/\ \\add\ /g; } if (!(/\\f.*?\[.*?\\f\*/)) { s/\]/\ \\add\*\ /g; } s///; s/xid\=\".*?\"//g; s/<.*?>//g; } print (USFM @lines); close USFM; }