I have below data to be translated
C1|C2
ABCD|EFGH
EFGH|ABCD
I want to transliterate only the specific colour, let’s say C2.
I tried this but
awk -F'|' -v OFS='|' -vcol=C2 'NR==1 {for(i=1;i<NF;i++){ if($i==col) {c=i;system("tr 'ABCD' 'EFGH'")}}} NR>1{system("tr 'ABCD' 'EFGH'")}' test.txt
8