in reply to Print record by column key

This should work (see code comments):
use strict; # will use this variable to hold third # column value of the last record. my $last_val; while(<DATA>) { chomp; next unless (m/.*<tab>.*<tab>\s*(\d{2,})/); # third column value has changed? print "\n" unless ($last_val == $1); # yes, skip to next line print; $last_val = $1; } __DATA__ 0<tab>761<tab>94 (041352) 0<tab>2311<tab> 94 (0.00) 0<tab>27<tab> 94 (NG012) 0<tab>892<tab>94 (04/23/2002) 0<tab>494<tab> 94 (520-004) 1<tab>343<tab> 38 (info) 1<tab>133<tab> 38 (info) 1<tab>345<tab> 94 (info)
Here's the output I get:
0<tab>761<tab>94 (041352) 0<tab>2311<tab> 94 (0.00) 0<tab>27<tab> 94 ( +NG012) 0<tab>892<tab>94 (04/23/2002) 0<tab>494<tab> 94 (520-004) 1<tab>343<tab> 38 (info)1<tab>133<tab> 38 (info) 1<tab>345<tab> 94 (info)


"There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith