# # Pad out file to same number of fields per record # Optimized to GAS format pedigree files, so ignores comment lines [#!] # AWK=/bin/gawk MISS="x" if [ "$1" = "" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ ! -f $1 ] then echo "Usage: pad [...] " echo " read data file, find maximum number of fields per record," echo " and pad out all records to that length using the missing" echo " data token \"$MISS\"." exit fi # # First find longest line # LONGEST=`$AWK 'BEGIN{max=0};$0 !~ /[#!]/ && NF>max {max=NF}; END{print max}' $*` $AWK -v target=$LONGEST -v miss=$MISS ' \ { if ($0 !~ /[#!]/ && NF