#!/afs/athena/contrib/perl/perl $RCS_ID = '$Id: tbl2lst,v 2.2 1992/06/20 11:44:48 hobbs Exp $' ; ($pgm = $0) =~ s-.*/-- ; $HelpInfo = < ){ # col names if( $EDT && /^\.\.>>>/ ){ print $_ ; next ; } # control line if( /^#\s|^\s+#/ ){ print ; next ; } # comment last ; } chop ; @H = split( /\t/, $_ ) ; $HH = $#H ; for (1..10){ push( @H, "-DATA-ERROR-" ) ; } while(){ # the data & definitions if( $EDT && /^\.\.>>>/ ){ $conl = $_ ; next ; } &conv ; } sub conv { # convert, output the record print "\n" ; # blank line seperates each record print $conl if $conl ; $conl = "" ; chop ; @F = split( /\t/, $_ ) ; for( $i=0 ; $i <= $HH || $i <= $#F ; $i++ ){ printf( "%13s | ", $H[$i] ) ; if( length($F[$i]) <= $lim ){ print $F[$i], "\n" ; } else{ $init = 0 ; $x = $F[$i] ; do { print "\t\t" if $init++ ; write ; } while( $x ) ; } } }