I have a 6 column array with 2 million rows that looks like this:
1 1089699 rs6686003 G A g
1 1090557 rs7553429 A C c
1 1094738 rs4970362 A G a
1 1099342 rs9660710 A C c
1 1106473 rs4970420 G A a
1 1108637 rs4970421 G A g
1 1119858 rs1320565 C T c
1 1120431 rs1320571 G A A
I need to change all lower case letters in the 6th column to uppercase. I wrote the following script, but all it is doing is changing every value in the 6th column to "A"
awk '{
if ($6="a") $6="A";
else if ($6="c") $6="C";
else if ($6="g") $6="G";
else if ($6="t") $6="T";
print $0;
}'
This is what I'm getting:
1 1089699 rs6686003 G A A
1 1090557 rs7553429 A C A
1 1094738 rs4970362 A G A
1 1099342 rs9660710 A C A
1 1106473 rs4970420 G A A
1 1108637 rs4970421 G A A
1 1119858 rs1320565 C T A
1 1120431 rs1320571 G A A
I have Ubuntu 16.04 LTS. Any help would be greatly appreciated.