#!/bin/sh export LANG=C export LC_CTYPE=C export LC_ALL=C [ -f /usr/local/bin/el ] && EL=/usr/local/bin/el [ -f `dirname $0`/../bin/el ] && EL=`dirname $0`/../bin/el if [ -z "${EL}" ]; then echo "el not found. Get it at 'cvs -d :pserver:anoncvs@cvs.erdgeist.org:/home/cvsroot co el'" exit 1 fi HO=`dirname $0`/../bin/hexout if [ $# -ne 1 ]; then echo "Syntax: $0 [phonebookdirectory]" exit 1 fi make -f Makefile all mkdir ../work cd ../work ../bin/decompress $1/streets.tl cat file_* > streets rm file_* ../bin/decompress $1/phonebook.db numfiles=`find . -name file_\* | wc -l` for column in `jot - 0 11 1`; do for file in `jot - ${column} ${numfiles} 11`; do acton=`printf file_%05x ${file}` if [ ${column} = 0 ]; then ${HO} < ${acton} >> column_0; else tr '\0' '\n' < ${acton} >> column_${column}; fi done; done mv column_0 01_Flags mv column_1 02_Nachname mv column_2 03_Vorname mv column_3 04_05_Namenszusatz_Addresszusatz mv column_4 09_Detail mv column_5 07_08_Strassenindex_Hausnummer mv column_6 12_Vorwahl mv column_7 10_Postleitzahl mv column_8 11_Ort mv column_9 13_Rufnummer mv column_10 14_15_Email_Webadresse [ -e streets ] && mv streets 99_Strassenname if [ -e 99_Strassenname ]; then cut -f 1 07_08_Strassenindex_Hausnummer | ${EL} -0 99_Strassenname > 07_Strasse else echo Could not convert streetindexes fi find . -name file_\* -delete