home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / trapstat.zip / trapstat.cmd
OS/2 REXX Batch file  |  1997-04-11  |  1KB  |  42 lines

  1. /* Simple popuplog.os2 statistics */
  2. /* hsn@cybermail.net */
  3.  
  4. parse arg file
  5.  if file='' then file='c:\popuplog.os2'
  6.  if 'READY:'\=stream(file,'C','OPEN READ') then return
  7.  pred=0;
  8.  pocet=0;
  9.  do while chars(file)>0
  10.   ln=linein(file)
  11.   if substr(ln,3,1)='-' then
  12.    if substr(ln,6,1)='-' then
  13.      if substr(ln,11,2)='  ' then 
  14.       do
  15.        pred=1;
  16.        iterate;
  17.       end
  18.   if pred=1 then do 
  19.                    /* najdi pozici */
  20.                    do i=1 to pocet
  21.                      if jm.i=ln then do
  22.                                        po.i=po.i+1;
  23.                                        pred=0;
  24.                                        leave;
  25.                                      end
  26.                    end                    
  27.                    if pred=0 then iterate;
  28.                    pocet=pocet+1;
  29.                    jm.pocet=ln
  30.                    po.pocet=1;
  31.                    pred=0;
  32.                  end;
  33.  end                   
  34.  say 'Results:'
  35.  say '========='
  36.  do i=1 to pocet
  37.   say jm.i po.i
  38.  end 
  39. return 
  40.        
  41.  
  42.