blob: f551fcbd58669f93d9dda19241a6ef9b5c609f3c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#!/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/<m\ .*?\/m>//;
s/props\=\".*?\"//g;
s/<p\ style=\"Kapitel\".*?><c.*?>(.*?)<\/c><\/p>/\n\\c\ $1\ \n\\v\ 1\ \ /g;
s/<p\ style=\"Psalm Nr\".*?><c.*?>Psalm\ (.*?)<\/c><\/p>/\n\\c\ $1\n\\s1\ Psalm\ $1\n/g;
s/<c\ style=\"Verszahl\".*?>(.*?)<\/c>/\n\\v\ $1\ \ /g;
s/<p\ style=\"Buchtitel\".*?>/\n\\mt\ /g;
s/<p\ style=\"Bucheinleitung\".*?>/\n\\imt\n\\ip\ /g;
s/<p\ style=\"Spaltentitel\".*?>(.*?)<\/p>/\n\\s2\ $1\n\\p/g;
s/<p\ style=\"Spaltenparallelen\".*?>(.*?)<\/p>/\n\\r\ $1\n\\p/g;
s/<p style=\"Footnote Text\".*><field\ footnote-id=\".*?\"/\ \\f\ +\ /g;
s/<\/foot>/\\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/<p\ style=\"Kopfzeile\".*?p>//;
s/xid\=\".*?\"//g;
s/<.*?>//g;
}
print (USFM @lines);
close USFM;
}
|