summaryrefslogtreecommitdiff
path: root/makecolumns.sh
diff options
context:
space:
mode:
Diffstat (limited to 'makecolumns.sh')
-rwxr-xr-xmakecolumns.sh82
1 files changed, 41 insertions, 41 deletions
diff --git a/makecolumns.sh b/makecolumns.sh
index 7b08a32..b128b46 100755
--- a/makecolumns.sh
+++ b/makecolumns.sh
@@ -115,48 +115,48 @@ handle_format_version_1() {
115} 115}
116 116
117handle_format_version_2() { 117handle_format_version_2() {
118 echo "Working on $1. Detected pre 02/1996 Telefonbuch version." 118 echo "Working on $1. Detected pre 02/1996 Telefonbuch version."
119 119
120 # Extract all CD's pkware compressed databases 120 # Extract all CD's pkware compressed databases
121 printf "Extracting 3 pkware databases ...\n" 121 printf "Extracting 3 pkware databases ...\n"
122 cd=1 122 cd=1
123 for database in `find "$1" -iname atb?dd00`; do 123 for database in `find "$1" -iname atb?dd00`; do
124 dir=`dirname ${database}` 124 dir=`dirname ${database}`
125 base=`basename ${database}` 125 base=`basename ${database}`
126 printf " %d/3 in %4s. Decompressing ... " ${cd} "$( basename ${dir} )" 126 printf " %d/3 in %4s. Decompressing ... " ${cd} "$( basename ${dir} )"
127 extract_version_2 "${database}" > ${base}.dump 127 extract_version_2 "${database}" > ${base}.dump
128 128
129 printf ", extracting ... " 129 printf ", extracting ... "
130 indexfile=$( find ${dir} -iname atb?di00 ) 130 indexfile=$( find ${dir} -iname atb?di00 )
131 split_version_2 "${base}.dump" "${indexfile}" 131 split_version_2 "${base}.dump" "${indexfile}"
132 132
133 printf ", cleaning up ... " 133 printf ", cleaning up ... "
134 rm "${base}.dump" 134 rm "${base}.dump"
135 printf "done.\n"
136 cd=$((cd+1))
137 done
138
139 mv 01_unknown 01_Flags
140 mv 16_unknown 02_Nachname
141 mv 07_unknown 03_Vorname
142 mv 14_unknown 04_Namenszusatz
143 mv 11_unknown 05_Adresszusatz
144 mv 12_unknown 06_Ortszusatz
145 mv 08_unknown 07_Strasse
146 mv 10_unknown 08_Hausnummer
147 mv 13_unknown 09_Fax_Verweise
148 mv 02_unknown 10_Postleitzahl
149 mv 15_unknown 11_Ort
150 mv 09_unknown 11_Ort_Gemeinde
151 mv 05_unknown 12_Vorwahl
152 mv 06_unknown 13_Rufnummer
153
154 # remove entries that are for searching only
155 rm 03_unknown 04_unknown
156
157 printf "Normalizing zusaetze ... "
158 lam 04_Namenszusatz 05_Adresszusatz | tr '\t' ' ' | sed -E s/' +'/' '/g > 04_Zusaetze
135 printf "done.\n" 159 printf "done.\n"
136 cd=$((cd+1))
137 done
138
139 mv 01_unknown 01_Flags
140 mv 16_unknown 02_Nachname
141 mv 07_unknown 03_Vorname
142 mv 14_unknown 04_Namenszusatz
143 mv 11_unknown 05_Adresszusatz
144 mv 12_unknown 06_Ortszusatz
145 mv 08_unknown 07_Strasse
146 mv 10_unknown 08_Hausnummer
147 mv 13_unknown 09_Fax_Verweise
148 mv 02_unknown 10_Postleitzahl
149 mv 15_unknown 11_Ort
150 mv 09_unknown 11_Ort_Gemeinde
151 mv 05_unknown 12_Vorwahl
152 mv 06_unknown 13_Rufnummer
153
154 # remove entries that are for searching only
155 rm 03_unknown 04_unknown
156
157 printf "Normalizing zusaetze ... "
158 lam 04_Namenszusatz 05_Adresszusatz | tr '\t' ' ' | sed -E s/' +'/' '/g > 04_Zusaetze
159 printf "done.\n"
160 160
161} 161}
162 162