BEGIN{FS="|";}{ x=index($0,"Act_TD_Logistic"); if ( (x>0) && ($6!=" o ") ){ printf("%sAct_TD_lRelu | | \n",substr($0,1,x-1)); } else { if ( (x>0) && ($6==" o ") ){ printf("%sAct_TD_Softmax | | \n",substr($0,1,x-1)); } else { printf("%s\n",$0); } } }