glue.awk - bag - Dutch BAG Kadaster Extract parser (subset)
 (HTM) git clone git://git.codemadness.org/bag
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       glue.awk (605B)
       ---
            1 BEGIN {
            2         FS = OFS = "\t";
            3 }
            4 # fields:
            5 # 1. bagnr
            6 # 2. postcode
            7 # 3. huisnummer
            8 # 4. huisletter
            9 # 5. huisnummertoevoeging
           10 # 6. status
           11 # 7. oppervlakte
           12 # 8. gebruiksdoel
           13 {
           14         if ($1 != prev) {
           15                 print v1 "\t" v2 "\t" v3 "\t" v4 "\t" v5 "\t" v6 "\t" v7 "\t" v8;
           16                 v1 = v2 = v3 = v4 = v5 = v6 = v7 = v8 = "";
           17                 prev = $1;
           18         }
           19 
           20         if ($1 != "")
           21                 v1 = $1;
           22         if ($2 != "")
           23                 v2 = $2;
           24         if ($3 != "")
           25                 v3 = $3;
           26         if ($4 != "")
           27                 v4 = $4;
           28         if ($5 != "")
           29                 v5 = $5;
           30         if ($6 != "")
           31                 v6 = $6;
           32         if ($7 != "")
           33                 v7 = $7;
           34         if ($8 != "")
           35                 v8 = $8;
           36 }
           37 END {
           38         print v1 "\t" v2 "\t" v3 "\t" v4 "\t" v5 "\t" v6 "\t" v7 "\t" v8;
           39 }