Copy column to another column in the same file
1
0
Entering edit mode
4.5 years ago
mropri ▴ 160

I have a gff3 file with 9 columns, I want to copy the 9th column and its content to column 2 of the same file so column 2 and 9 will look identical. Was hoping if there is a way to do that. Appreciate all the help.

ChIP-Seq • 783 views
ADD COMMENT
0
Entering edit mode
4.5 years ago
Ram 44k
awk -F "\t" -vOFS="\t" 'NR==1{print} NR>1{print $1,$9,$3,$4,$5,$6,$7,$8,$9}' my_gff3_file.gff
ADD COMMENT
0
Entering edit mode

Thank you for your help. It works, but how do I make the change permanent.

ADD REPLY
1
Entering edit mode

Pipe it to a new file by tacking > your_new_file.gff on the end.

ADD REPLY
0
Entering edit mode

Thank you very much!

ADD REPLY

Login before adding your answer.

Traffic: 1901 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