X-Git-Url: https://nuage.metani.fr/gitweb/3GPP.git/blobdiff_plain/3f8c64341ab3454eaea4f84f6787d6d0c5ae23d3..refs/heads/main:/bin/38331-convert.sh diff --git a/bin/38331-convert.sh b/bin/38331-convert.sh index dd99a4a..2faf212 100755 --- a/bin/38331-convert.sh +++ b/bin/38331-convert.sh @@ -60,6 +60,9 @@ else LC_ALL=C sed -i 's/-- Cond N3C MP/-- Cond N3C-MP/' "${1%.docx}.txt" LC_ALL=C sed -i 's/^N3C MP/N3C-MP/' "${1%.docx}.txt" LC_ALL=C sed -i 's/-- Cond HOAndServCellAdd,$/-- Cond HOAndServCellAdd/' "${1%.docx}.txt" + + iconv -f UTF-8 -t ASCII//TRANSLIT "${1%.docx}.txt" > "${1%.docx}.ascii" + mv "${1%.docx}.ascii" "${1%.docx}.txt" fi cat "${1%.docx}.txt" | awk '/^-- ASN1START$/,/^-- ASN1STOP$/' | awk '!/^[[:space:]]*--/ && !/^[[:space:]]*$/'| sed -e 's/--.*$//g' > "${1%.docx}.asncheck" @@ -69,9 +72,9 @@ if [[ ! -e "${1%.docx}.asncheck" ]] ; then exit fi -mkdir by-IE +mkdir -p by-IE cd by-IE -txt2asn.awk "../${1%.docx}.txt" > "${1%.docx}.asn" +txt2asn.awk "../${1%.docx}.txt" | awk '/^$/{ if (! blank++) print; next } { blank=0; print }' > "${1%.docx}.asn" cat "${1%.docx}.asn" | awk '!/^[[:space:]]*--/ && !/^[[:space:]]*$/'| sed -e 's/--.*$//g' > "${1%.docx}.asncheck" compare1=$(diff -b -B "../${1%.docx}.asncheck" "${1%.docx}.asncheck") if [[ "$compare1" ]] ; then @@ -80,12 +83,13 @@ if [[ "$compare1" ]] ; then echo " diff -b -B by-IE/${1%.docx}.asncheck ${1%.docx}.asncheck" else rm "${1%.docx}.asncheck" + asn1-split.awk "${1%.docx}.asn" fi cd .. -mkdir before-field +mkdir -p before-field cd before-field -txt2asn-integrated.awk "../${1%.docx}.txt" > "${1%.docx}.asn" +txt2asn-integrated.awk "../${1%.docx}.txt" | awk '/^$/{ if (! blank++) print; next } { blank=0; print }' > "${1%.docx}.asn" cat "${1%.docx}.asn" | awk '!/^[[:space:]]*--/ && !/^[[:space:]]*$/'| sed -e 's/--.*$//g' > "${1%.docx}.asncheck" compare2=$(diff -b -B "../${1%.docx}.asncheck" "${1%.docx}.asncheck") if [[ "$compare2" ]] ; then @@ -94,6 +98,7 @@ if [[ "$compare2" ]] ; then echo " diff -b -B before-field/${1%.docx}.asncheck ${1%.docx}.asncheck" else rm "${1%.docx}.asncheck" + asn1-split.awk "${1%.docx}.asn" fi cd ..