First and Second Column are always the same number of characteristics (words). I wanna Third Column will print out exactly the same words as First Column but corrected/replaceed all N based on corresponding word position at Second Column word.
Thank you for asking good question, please keep it up. Coming to your requirement now, off course SHELL can't understand you BOLD characters(which you actually made for us to understand) so considering that you character/characters N will come in a continuous sequence only, following may help you in same.
Here you need to give you all strings which you want to be substituted(in newly created 3rd column) in split("ATC:C:TCGCG:G", array,":") highlighted column of split according to their sequence/line vice and it should fly then. If you have more permutations/combinations for this please do let us know on same then.
EDIT: We could put split code into BEGIN section so that array will be created only once. As follows a minor change in above code.
Thanks a lot and very much, R. Singh.
It worked perfectly now
---------- Post updated at 02:12 AM ---------- Previous update was at 01:44 AM ----------
Hi R. Singh,
Sorry again for disturbing.
I just find out one more new interesting issue.
Is it possible that your awk command continue to search through all the "N" in first column and replace based on corresponding position at second column?
I notice if I have 3 N at different position of first column.
The awk command will replace only the first N and stop replace other N in the first string.
eg.