summaryrefslogtreecommitdiff
path: root/word2org.sh
diff options
context:
space:
mode:
Diffstat (limited to 'word2org.sh')
-rwxr-xr-xword2org.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/word2org.sh b/word2org.sh
new file mode 100755
index 0000000..2aff59f
--- /dev/null
+++ b/word2org.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+export LANG='en_US.UTF-8'
+quote=''
+quote_credit=''
+block=''
+
+out=$1
+
+while read line; do
+ case "$line" in
+ '“'*) # quote
+ line="`echo "$line"|sed 's/[“”]//g'`"
+ quote="$quote $line"
+ :;;
+ '-'*) # quote-credit
+ credit="`echo "$line"|sed 's/^-//'`"
+ block="$block
+*** $credit
+ $quote"
+ quote=''
+ :;;
+ 'Reporter: '*) # reporter-credit
+ reporter="`echo "$line"|sed 's/^Reporter: //'`"
+ echo "** $reporter$block"
+ block=''
+ :;;
+ '') :;; # blank
+ *) # error
+ echo "error: \`$line'" >>/dev/stderr
+ exit 1;;
+ esac
+done