define integer l nwin
let l 0
!
sic find *.hpb
for i 1 to dir%nfile
  !
  file in 'dir%file[i]'
  find /sou &3
  if (found.ne.0) then
    let l l+1
    let nwin spw%nsb/2
    for k 1 to nwin
      set selection l0'k' and l0'k+nwin'  ssb line
      !
      if l.eq.1 then
        table 'table_prefix'Line-'k'.uvt new 
      else
        table 'table_prefix'Line-'k'.uvt
      endif
    next
  endif
next
~
