program big_mess { big_mess # < in > out } ; { Reads an exported mail/news file and reports long messages. Parameter '#' is number of lines, including header, over which is long. Count is approximate as the position of Message-ID in the headers will vary. Lines in the body starting Message-ID: will deceive program. } var S1, S2 : string ; N1, N2, NM : longint ; J : integer ; const Over : longint = 100 ; MID = 'Message-ID:' ; Sp = #32 ; procedure MayWrite ; begin if (N1-N2)>Over then Writeln(NM:5, Sp, N2:9, Sp, N1-N2:8, Sp, Copy(S2, Length(MID)+2, 255)) ; end {MayWrite} ; BEGIN Writeln('BIG_MESS.PAS www.merlyn.demon.co.uk >= 2000-07-28') ; if ParamCount>0 then begin Val(ParamStr(1), Over, J) ; if J<>0 then begin Writeln('Bad number "', ParamStr(1), '", fail!') ; EXIT end ; end ; N1 := 0 ; NM := 0 ; Writeln('MIDno At Line Lines ', MID) ; while not EoF do begin Readln(S1) ; Inc(N1) ; if Copy(S1, 1, Length(MID))=MID then begin MayWrite ; N2 := N1 ; S2 := S1 ; Inc(NM) end ; end ; MayWrite ; Writeln(NM:5, ' messages; OK.') ; END.