I have multiple (22) files that are named like this:
chr1.out, chr2.out...,chr22.out
each of those files has 46 columns and multiple lines
The first 6 columns and 6 rows in one of those files looks like this:
alternate_ids rsid chromosome position alleleA alleleB index
rs4814683 rs4814683 NA 9795 G T 1
rs6076506 rs6076506 NA 11231 T G 2
rs6139074 rs6139074 NA 11244 A C 3
rs1418258 rs1418258 NA 11799 C T 4
rs7274499 rs7274499 NA 12150 C A 5
rs6116610 rs6116610 NA 12934 G A 6
Let's say this is in file chr1.out
what I would like to do is to replace all NAs in column chromosome with 1.
so it would look like this:
alternate_ids rsid chromosome position alleleA alleleB index
rs4814683 rs4814683 1 9795 G T 1
rs6076506 rs6076506 1 11231 T G 2
rs6139074 rs6139074 1 11244 A C 3
rs1418258 rs1418258 1 11799 C T 4
rs7274499 rs7274499 1 12150 C A 5
rs6116610 rs6116610 1 12934 G A 6
I would like to do the same for each of those 22 files. So chr2.out get 2 in 3rd column, chr3.out get's 3 in 3rd column etc