Skip to content
Vince Buffalo edited this page Jan 29, 2014 · 1 revision

Convert an older MD5 sum file to modern format

I had an MD5sum file that wasn't compatible with newer md5sum. It looked like:

    BKN033_ZEAHRFRATDIAAPE_5.bam      5d33960d40b3d2d3561a1111565fd45e
    BKN033_ZEAHRFRATDIAAPE_6.bam      461d7874014bb0a0042a12d4a6177d66

Using command substitution and sed, awk, and cut, this is fairly easy to solve:

md5sum -c <(sed 's/ \+/\t/g' BKN.md5 | cut -f2,3 | awk '{print "MD5(" $1 ") = "$2}')
Clone this wiki locally