# pad_edm.ak #awkm to convert a Excel comma deliminated list of files and create a list to copy and rename then #NOTE: add one to the last lineament number to get the last one BEGIN { #FS = "," # comma deliminated files } #Middle { # printf("%s length %s\n",$1, length($1)) if (NF == 2) { #get's rid of lines with no names if (length($1) == 6) printf("%s0%s %s\n",substr($1,1,1),substr($1,2), $2) else if (length($1) == 5) printf("%s00%s %s\n",substr($1,1,1),substr($1,2), $2); else if (length($1) == 4) printf("%s000%s %s\n",substr($1,1,1),substr($1,2), $2); else if (length($1) == 3) printf("%s0000%s %s\n",substr($1,1,1),substr($1,2), $2); else if (length($1) == 7) printf("%s %s\n",$1, $2); } } END { }