summaryrefslogtreecommitdiff
path: root/Xenogears/map2sqr
diff options
context:
space:
mode:
authorPixel <Pixel>2002-05-04 17:53:08 +0000
committerPixel <Pixel>2002-05-04 17:53:08 +0000
commit24fb33726eca4e8c5a88797adc9c17f4d541f543 (patch)
tree72b385bd9e880e699e43c7db3ba12817f0e8e45e /Xenogears/map2sqr
Initial revision
Diffstat (limited to 'Xenogears/map2sqr')
-rwxr-xr-xXenogears/map2sqr34
1 files changed, 34 insertions, 0 deletions
diff --git a/Xenogears/map2sqr b/Xenogears/map2sqr
new file mode 100755
index 0000000..4621d54
--- /dev/null
+++ b/Xenogears/map2sqr
@@ -0,0 +1,34 @@
+#!/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 < NR; i++) {
+ $(i - 4) = $i;
+ }
+ NF -= 4;
+ print $0;
+}
+
+END {
+ print 0;
+}