summaryrefslogtreecommitdiff
path: root/htmtojargon.awk
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2013-03-31 18:32:08 +0100
committerNick White <git@njw.me.uk>2013-03-31 18:32:08 +0100
commit2742524159ad2bc861711df084f6bd77588e9e9b (patch)
tree00508f5d2b5232a8d10298acb59facf86f6f5ff9 /htmtojargon.awk
downloadoed2dict-2742524159ad2bc861711df084f6bd77588e9e9b.tar.bz2
oed2dict-2742524159ad2bc861711df084f6bd77588e9e9b.zip
Initial commit
Diffstat (limited to 'htmtojargon.awk')
-rw-r--r--htmtojargon.awk17
1 files changed, 17 insertions, 0 deletions
diff --git a/htmtojargon.awk b/htmtojargon.awk
new file mode 100644
index 0000000..16c5356
--- /dev/null
+++ b/htmtojargon.awk
@@ -0,0 +1,17 @@
+#!/usr/bin/awk -f
+# dirty xml reading is more fun
+
+BEGIN {
+ FS = "</hg>"
+}
+
+{ printdefs($1, $2); }
+
+function printdefs(word, defs) {
+ n = split(defs, array, "<def>");
+ for(i=0; i<=n; i++) {
+ if(array[i] != "") {
+ printf(":%s: %s\n", word, array[i]);
+ }
+ }
+}