Hi Biostars community
I have a file with positions of methylated cytosines , but I want to add a new column to this file with the position+1 value (as if it was a dinucleotide).
I have used awk to print our the new value, but I need to add this new column to my file.
My file looks like this
NC_001960.1 1067
NC_001960.1 1068
NC_001960.1 1069
NC_001960.1 1133
And I do this with awk: awk -v s=1 '{print $(NF)+s}' test
Which gives me this output:
1068
1069
1070
1134
And I´d like to add this as the third column in the above file
NC_001960.1 1067 1068
NC_001960.1 1068 1069
NC_001960.1 1069 1070
NC_001960.1 1133 1134
Is it possible to do this with awk or with some other method?
Allright, that was so easy I´m almost embarrassed :) thanks a bunch!
If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.