Skip to content

Instantly share code, notes, and snippets.

@andrewgilmartin
Created February 13, 2011 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewgilmartin/824889 to your computer and use it in GitHub Desktop.
Save andrewgilmartin/824889 to your computer and use it in GitHub Desktop.
# This GIST has no other purpose than to demostrate that single-line perl scripts rock.
# This one extracts the time-stamp and duration from each matching record.
perl -ne 'if ( /(\d\d):(\d\d):(\d\d).*duration:\s*([\d,]+)ms/ ) { $time = ($1*60+$2)*60+$3; ( $duration = $4 ) =~ s/[^\d]//; printf( "%8d %5d\n", $time, $duration ); }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment