#!/bin/zsh echo -n "Making test data . . ." perl -le '$t = time - 5 * 86400 ; for( 1..1_000_000 ) { print scalar localtime $t, " random " x (int(rand(3))+1); $t += int( rand( 120 ) + 120 ) }' > testlog echo " done" for i in 1 2 3 4 ; do time perl -lne 'print "", substr($_,0,24), " ", substr($_,25)' testlog > /dev/null ; done for i in 1 2 3 4 ; do time perl -lne '/^(.{24}) (.*)$/; print "", $1, " ", $2' testlog > /dev/null ; done for i in 1 2 3 4 ; do time perl -lne '($d,$r)=unpack("A24A*", $_);print "", $d, "", $r' testlog > /dev/null ; done for i in 1 2 3 4 ; do time ruby -lne 'print "", $_[0,24], " ", $_[25,$_.length]' testlog > /dev/null ; done rm testlog exit 0