# Description: # This script is designed to turn a plain text file which contains a list of term # and their definitions into a DocBook XML glossary using the appropriate DocBook tags # In this case the terms and their definitions are on the same line so that the text file # looks like... # soup a type of meal which is liquid # bag a thing for carrying other things in # etc # # Notes: # This appeared to work for the file provided by Robert Grundy # # Dependencies: # # A reasonable Bash shell, a good 'sed' if [ "$1" = "" ] then echo "usage: $0 textFileName " cat $0 | sed -n "/^[ ]*#/p" exit 1; fi echo "" # catdoc -w robert-glossary.doc expand $1 | \ #-- get rid of the 'field titles' sed "1d" | \ sed -e "s/^[ ]*//g" -e "s/[ ]*$//g" | \ sed "/^[ ]*$/d" | \ sed "/[ ]\{2,\}[^ ]/ s#\(.*\)[ ]\{2,\}\(.*\)#\1\2#g" | \ sed "/[ ]\{2,\}[^ ]/! s#\(.*\)#\1#g" | less echo ""