BEGIN {FS = ","; OFS = ",";} { for (i=1; i <= NF; i++) { # printf(" In match_string, column %d is \"%s\"\n",i,$i); # if (tolower($i) == tolower(match_string)) if (match($i,match_string) != 0) { # printf("%s\n",$i); printf("%s",$(i + 1)); } } }