diff options
-rw-r--r-- | src/makecolumns.sh | 37 |
1 files changed, 37 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | EL=`dirname $0`/el | ||
4 | HO=`dirname $0`/hexout | ||
5 | |||
6 | numfiles=`ls file_* | wc -l` | ||
7 | |||
8 | for column in `jot - 0 11 1`; do | ||
9 | for file in `jot - ${column} ${numfiles} 11`; do | ||
10 | acton=`printf file_%05x ${file}` | ||
11 | if [ ${column} = 0 ]; then | ||
12 | ${HO} < ${acton} >> column_0; | ||
13 | else | ||
14 | tr '\0' '\n' < ${acton} >> column_${column}; | ||
15 | fi | ||
16 | done; | ||
17 | done | ||
18 | |||
19 | mv column_0 01_Flags | ||
20 | mv column_1 02_Nachname | ||
21 | mv column_2 03_Vorname | ||
22 | mv column_3 04_05_Namenszusatz_Addresszusatz | ||
23 | mv column_4 09_Detail | ||
24 | mv column_5 07_08_Strassenindex_Hausnummer | ||
25 | mv column_6 12_Vorwahl | ||
26 | mv column_7 10_Postleitzahl | ||
27 | mv column_8 11_Ort | ||
28 | mv column_9 13_Rufnummer | ||
29 | mv column_10 14_15_Email_Webadresse | ||
30 | |||
31 | [ -e streets ] && mv streets 99_Strassenname | ||
32 | |||
33 | if [ -e 99_Strassenname ]; then | ||
34 | cut -f 1 07_08_Strassenindex_Hausnummer | ${EL} -0 99_Strassenname > 07_Strasse | ||
35 | else | ||
36 | echo Could not convert streetindexes | ||
37 | fi | ||