shift
continue
fi
+
+ # On windows, soffice adds CR characters at line ends and produces EN-DASH in Windows-1252 enconding, i.e. 0x96
+ # Remove the CR at each line end and convert EN-DASH to normal minus
+ echo "${1%.docx}.txt"
+ LC_ALL=C sed -i $'s/\x96/-/g' "${1%.docx}.txt"
+ LC_ALL=C sed -i $'s/\r$//' "${1%.docx}.txt"
+
fi
if [[ -e "${1%.docx}.asn" ]] ; then
continue
fi
- sed -i 's/\r$//' "${1%.docx}.txt"
+
cat "${1%.docx}.txt" | awk '/^-- ASN1START$/,/^-- ASN1STOP$/' | grep -Evxe '-- ASN1ST(ART|OP)' | grep -v '^--' | awk 'NF || p; { p = NF }' p=0 > "${1%.docx}.asn"
if [[ -e "${1%.docx}.asn" ]] ; then