After processing usually follows the maddeningly slow crawl through 454BaseCallerMetrics.txt to find out whether it is a good day or not. Typically I egrep for a few keywords (eg "totalBases") to get an idea. But, even then I am squinting at the screen, counting digits to see if all went well. How about a nice perl one-liner that will pull the lines of interest and add commas in the right places in long numbers?
That sweet "insert commas into numbers" regex courtesy of Randall Schwartz:
--
Phillip
Code:
perl -ne 's/(\d)(?=(\d{3})+(\D|$))/$1\,/g; print if /region|numberReads|totalBases|average|key/;' 454BaseCallerMetrics.txt
That sweet "insert commas into numbers" regex courtesy of Randall Schwartz:
--
Phillip
Comment