#!/usr/bin/gawk -f BEGIN{ IGNORECASE = 1; FS=OFS=" "; line=0; test=0; a=b=c==d=0; } /test data/{test=1;next;} /confusion matrix/ && test==1{line=1;next;} line==1||line==2{line++;next;} line==3 && test == 1{ a=$1; c=$2; line++; next; } line==4 && test == 1{ b=$1; d=$2; line++; } END{ pd = 0; pf = 0; if ( d+b != 0 ) pd = d/(d+b); if ( a+c != 0 ) pf = c/(a+c); print pd*100 "," pf*100; }