summaryrefslogtreecommitdiff
path: root/Xenogears/map2sqr
blob: a5739a0c81571ac39c7e8c6128ed8caac0ede6fe (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
#!/usr/bin/awk -f
BEGIN {
    ol = -1;
}

NR <= 4 {
    print $0;
}

NR > 4 {
    f = $1;
    l = $2;
    c = l - f + 1;
    if ((ol + 1) != f) {
	print "You blew it @ line", NR > "/dev/stderr"
	exit -1;
    }
    ol = l;
    print c;
    
    d = $3;
    print d;
    d = $4;
    print d;

    for (i = 5; i <= NF; i++) {
	$(i - 4) = $i;
    }
    NF -= 4;
    print $0;
}

END {
    print 0;
}