I have a file like the following: 0/1:34:89:09    0/0:985:083:67 0/1:687:90887:975    0/1:54:79:25    0/0:5:83:67 0/1:67:9087:97  0/1:574:779:225 0/0:275:73:627 0/1:67:47:77I want to replace any column which have 0/0 in the beginning with homo, so that my desired file will look like the following: 0/1:34:89:09    homo 0/1:687:90887:975  0/1:54:79:25    homo 0/1:67:9087:97 0/1:574:779:225 homo 0/1:67:47:77
Replace string if it has a common pattern
text processing
I'll assume homo refers to same, as in this processing will be applied equally across all input files, regardless of extension.sed -iBAK 's_\(0/0:[0-9]\+:[0-9]\+:[0-9]\+\)_homo_g' text.txtThe -iBAK makes a backup of the original file with a BAK suffix.