How I can change the fifth column of these rows
1
0
Entering edit mode
6.4 years ago
hosin • 0

I have many many rows (about 6000) from PennCNV software, icludes 7 columns , like these:

chr10:70920533-70921956       numsnp=3      length=1,424       state1,cn=0 WDS1_1.adjusted startsnp=oar3_OAR10_70920533 endsnp=oar3_OAR10_70921956
chr15:2694950-2706055         numsnp=4      length=11,106      state1,cn=0 WDS1_1.adjusted startsnp=oar3_OAR15_2694950 endsnp=oar3_OAR15_2706055
chr20:25669233-25685291       numsnp=5      length=16,059      state5,cn=3 555individual555.new.adjusted startsnp=oar3_OAR20_25669233 endsnp=oar3_OAR20_25685291
chr20:25876183-25899904       numsnp=8      length=23,722      state5,cn=3 555individual555.new.adjusted startsnp=oar3_OAR20_25876183 endsnp=oar3_OAR20_25899904

So how I can change the fifth column, like :

chr10:70920533-70921956       numsnp=3      length=1,424       state1,cn=0 1v startsnp=oar3_OAR10_70920533 endsnp=oar3_OAR10_70921956
chr15:2694950-2706055         numsnp=4      length=11,106      state1,cn=0  2v startsnp=oar3_OAR15_2694950 endsnp=oar3_OAR15_2706055
chr20:25669233-25685291       numsnp=5      length=16,059     state5,cn=3 3v startsnp=oar3_OAR20_25669233 endsnp=oar3_OAR20_25685291
chr20:25876183-25899904       numsnp=8      length=23,722     state5,cn=3 4v startsnp=oar3_OAR20_25876183 endsnp=oar3_OAR20_25899904

Please help me .Thanks.

genome • 888 views
ADD COMMENT
0
Entering edit mode

Hello hosein_salehi6,

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

Thank you!

fin swimmer

ADD REPLY
0
Entering edit mode
6.4 years ago

Hello,

you can do it with awk:

$ awk -v OFS="\t" '{print $1, $2, $3, $4, NR"v", $6, $7}' input.txt

fin swimmer

ADD COMMENT

Login before adding your answer.

Traffic: 1927 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6