summaryrefslogtreecommitdiff
path: root/VP
diff options
context:
space:
mode:
authorPixel <Pixel>2002-05-25 05:35:07 +0000
committerPixel <Pixel>2002-05-25 05:35:07 +0000
commitc19473a09f0e7a0262a603faee0b0e50654c0bae (patch)
tree6ee80c696cd302d03b37a816915051b08f15c4a4 /VP
parent28374301bfd1f96490c1906cd239be05af062953 (diff)
Welcome to the DTE thing.
Diffstat (limited to 'VP')
-rwxr-xr-xVP/map2sqr35
1 files changed, 35 insertions, 0 deletions
diff --git a/VP/map2sqr b/VP/map2sqr
new file mode 100755
index 0000000..a5739a0
--- /dev/null
+++ b/VP/map2sqr
@@ -0,0 +1,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;
+}