diff options
Diffstat (limited to 'htmtojargon.awk')
-rw-r--r-- | htmtojargon.awk | 17 |
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]); + } + } +} |