pro srchpacket,fn,packetnum,packetbyte ; Search file named fn for the start of packets packetbyte=lonarr(100000L) packetnum=0 close,1 openr,1,fn bytes=0L d=0B while 0 eq 0 do begin while (d ne '0f'X) and (not eof(1)) do begin readu,1,d bytes=bytes+1 endwhile if eof(1) then goto, done readu,1,d bytes=bytes+1 if d eq '92'X or d eq 'b2'X then begin packetnum=packetnum+1 packetbyte(packetnum-1)=bytes-1 endif endwhile done: packetbyte=packetbyte(0:packetnum-1) end