From 2d1db4b17f5afa5dcf1f5d586a64bc3b72876084 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 4 Feb 2019 00:09:03 +0100 Subject: Further unify output for all years --- makecolumns.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/makecolumns.sh b/makecolumns.sh index 429d926..2b65307 100755 --- a/makecolumns.sh +++ b/makecolumns.sh @@ -112,7 +112,7 @@ handle_format_version_1() { mv 07_unknown 07_Strasse mv 08_unknown 08_Hausnummer mv 09_unknown 04_Namenszusatz - mv 10_unknown 09_Fax_Verweise + mv 10_unknown 09_Verweise mv 11_unknown 12_Vorwahl mv 12_unknown 13_Rufnummer mv 13_unknown 11_Ort @@ -155,7 +155,7 @@ handle_format_version_2() { mv 12_unknown 06_Ortszusatz mv 08_unknown 07_Strasse mv 10_unknown 08_Hausnummer - mv 13_unknown 09_Fax_Verweise + mv 13_unknown 09_Verweise mv 02_unknown 10_Postleitzahl mv 15_unknown 11_Ort mv 09_unknown 11_Ort_Gemeinde @@ -227,7 +227,7 @@ handle_format_version_3() { cut -c 1 < 01_unknown > 01_Flags cut -c 2- < 01_unknown > 02_Nachname fi - #rm 01_unknown + rm 01_unknown printf "done.\n" printf "Splitting decompress vname chunks into their columns ... " @@ -265,8 +265,12 @@ handle_format_version_3() { mv 11_unknown 11_Ort mv 12_unknown 12_Vorwahl mv 13_unknown 13_Rufnummer - [ -f 14_unknown ] && mv 14_unknown 14_Email - [ -f 15_unknown ] && mv 15_unknown 15_Webadresse + if [ -f 14_unknown -a -f 15_unknown ]; then + paste 15_unknown 14_unknown | sed 's/[[:space:]]$//g' > 14_15_Email_Webadresse + rm 14_unknown 15_unknown + else + tr -dC '\n' < 01_Flags > 14_15_Email_Webadresse + fi printf "Normalizing flags ... " sed -i.bak -e s:^1$:00:g -e s:^3$:01:g -e s:^2$:02:g 01_Flags @@ -311,6 +315,8 @@ handle_format_version_3() { rm 90_Geokoordinaten_hnr_raw paste 10_Postleitzahl 11_Ort 07_Strasse 08_Hausnummer | map_coords 90_Geokoordinaten_hnr | convert_coords > 16_Koordinaten printf "done.\n" + else + tr -dC '\n' < 01_Flags > 16_Koordinaten fi if [ -f "${braid}" ]; then -- cgit v1.2.3