I've read here that I can replace the values of all columns containing a particular text using
awk -F'\t' -vOFS='\t' '{ gsub("CC", "C", $1) ; gsub("AA", "A", $1) ; print }'
But where do I tell awk
the name of the file I want to perform this operation on? And instead of searching for the literal "CC", how can search for a column matching the pattern A{7}
?
awk
is like most Unix commands: it reads from files named on the command line, or fromstdin
if no filenames are given.