is it possible to print the field that contain a certain value? Consider below file: foo,boo,123,1234312,ABCfoo,boo,ABC,bla,blaThere is a field that contain ABC but it is not a fixed with all records, so the command need to print $5 in the first record and $3 in the second one. 
print field that contain a certain value
text processing;awk
Yes, just like in your previous question, but match each field:$ awk -F, '{for(i=1;i<=NF;i++){if($i~/ABC/){print $i}}}' fileABCABCNote that the above will also print a filed that contains ABC, like fooABC or fooABCbar or whatever. To print only fields that are ABC, use:awk -F, '{for(i=1;i<=NF;i++){if($i==ABC){print $i}}}' fileThe same thing, in Perl:perl -F, -lane 'print grep{/ABC/}@F' file     ## field matchesperl -F, -lane 'print grep{$_==ABC}@F' file ## field is