-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtmlExample.awk
More file actions
35 lines (29 loc) · 1.05 KB
/
Copy pathhtmlExample.awk
File metadata and controls
35 lines (29 loc) · 1.05 KB
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
# Print out each Jagacy Total Access license agreement (see license_ta.html):
BEGIN {
# These can also be specified on the command line.
IT = "html:htmlQuery=/html/body/p,word2000=true";
FS = "[\t]";
}
!isXmlNulNode(licenseTitleNode = getXmlNode(_$NODE, "./b/a/text()")) {
description = "";
print "";
print getXmlNodeValue(licenseTitleNode);
# Print first line:
getXmlNodeArray(_$NODE, ".//font/text()|.//span/text()", descriptionArray);
for (i in descriptionArray) {
value = trim(getXmlNodeValue(descriptionArray[i]));
gsub(/[\r\n ]+/, " ", value);
description = description " " value;
}
print description;
description = "";
# Print second line:
nextNode = getXmlNode(_$NODE, "./following-sibling::p");
getXmlNodeArray(nextNode, ".//font/text()", descriptionArray);
for (i in descriptionArray) {
value = trim(getXmlNodeValue(descriptionArray[i]));
gsub(/[\r\n ]+/, " ", value);
description = description " " value;
}
print description;
}