Quote:

>>I need to find gaps in a long listing.

>>Is it possible to make calculations on two lines to find this?

>>The listing goes like this

>>340

>>341

>>342

>>343

>>345 Gap

>>346

>>.

>If its guarantee'd to be sorted, try

> {if ($1+0 != prev) print "Gap from ", prev, "to" $0

> prev=$1+0}

Oops I made a typo

While I was at it I included a useful bit of information - namely

the line number (NR). Here is the full program - tested this time!

{if ($1-1 != prev) print "On line ", NR,"- gap from ", prev, "to " $0

prev=$1+0}

Mark

--

Mark Katz

ISPC, London - Innovation in data-delivery tools

Tel: (44) 181-455 4665, Fax (44) 181-458 9554

** See our website at http://www.efiche.com/efiche **