sort with header maintained

Originally published on my old Blogger blog on August 25, 2015. Read the original post and its comments.

We usually want to maintain header when we do something for the body of the text.
You can find a body function here which can only accept streams and assumes only one line header.

Use subshells and awk can do the same job and potentially more flexible.

View this gist on GitHub

The original credits go to Aaron Quinlan. see a gist below to sort vcf files in natural chromosome order :chr1 chr2 chr3.... rather than chr1 chr10 chr11....

View this gist on GitHub

Related

Next
Previous
comments powered by Disqus