#!/usr/bin/perl =head1 NAME preformat.pl - NSSDC PSPG-00070 preformatter =head1 SYNOPSIS ./preformat.pl < FILE.DAT =head1 DESCRIPTION The preformat.pl converts NSSDC PSPG-00070 to a preformatted text. =cut %lngth = ('G'=>72,'F'=>66,'H'=>78, 'D'=>54,'A'=>36,'|'=>18, 'E'=>60,'B'=>42,'^'=>24); $headlen = 6; $label_length = 12; $blksize = 1344; $content = ''; while(read(STDIN, $buf, 2)) { $size = unpack("n", $buf); read(STDIN, $buf, $size); $content .= substr($buf,0,$blksize); } $data = substr($content,$label_length); $i = 0; while($i