From cfc72d1e3bd2c9400fecc539bb4a13d5a6603fe3 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Wed, 17 Oct 2007 11:36:41 +0000 Subject: Column maker --- src/makecolumns.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/makecolumns.sh (limited to 'src') diff --git a/src/makecolumns.sh b/src/makecolumns.sh new file mode 100644 index 0000000..d53b26b --- /dev/null +++ b/src/makecolumns.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +EL=`dirname $0`/el +HO=`dirname $0`/hexout + +numfiles=`ls 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 -- cgit v1.2.3