in reply to Any hints on how to do this?
prints:perl -ape 'substr($_,0,length $l) =~ tr/ / /c if $F[0] eq $l;$l=$F[0]' + <<END GEORGE 21 GEORGE 45 NICK 12 PETER 27 JIM 18 JIM 87 CHRIS 33 END
On review, I see that my solution is practically the same as CountZero's $saved_name algorithm, but needs no pre-calculated size for the 'name' field.GEORGE 21 45 NICK 12 PETER 27 JIM 18 87 CHRIS 33
|
|---|