BEGIN { bottom = 0; right = 0; FS = ","; OFS="" } { if ( ($1 + $3) > right ) { right = $1 + $3; } } { if ( ($2 + $4) > bottom ) { bottom = $2 + $4; } } END { print right, ",", bottom }