summaryrefslogtreecommitdiff
path: root/src/makecolumns.sh
blob: d53b26b30c27922bb946fe4e3c3c40943bd9c1cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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