#!/usr/bin/perl open (OUT,">$ARGV[0]") or die ; while () { chomp ; tr/ \t/ /s ; s/^ // ; if (/^2 1 0 1 0/) { @f = split(/ /) ; $n = $f[15] ; next ; } unless ($n) { next ; } @f = split(/ /) ; for ($i = 0; $i < @f; $i+=2) { $x = $f[$i] ; $y = $f[$i+1] ; # print "$x $y\n" ; $d = pack('s',$y) ; print OUT $d ; } }