{ZMIENIA KOD <155> NA KODY <13,10> W PLIKU TEKSTOWYM}
USES CRT;
CONST F1:BYTE=13;
      F2:BYTE=10;
VAR Color:BYTE;
    InFile,OutFile:File Of Byte;
    I,II:LONGINT;
    ZNAK:Byte;
BEGIN
   Color:=TextAttr;
   IF ParamCount <> 2 THEN BEGIN
      WriteLn;
      TextColor(LightRed);WriteLn('PC_EOL v1.0');
      TextColor(Yellow);Writeln('Convert code <155> to codes <13,10>');
      TextColor(Green);WriteLn('   Usage: PC_EOL <infile> <outfile>');
      TextColor(Color);WriteLn;
      Halt;
   END;
   Assign(InFile,ParamStr(1));
   Assign(OutFile,ParamStr(2));
   {$I-}Reset(InFile);{$I+}
   IF IOResult<>0 THEN BEGIN
      WriteLn;
      TextColor(LightRed);WriteLn('File ',ParamStr(1),' not found');
      TextColor(Color);WriteLn;
      Halt;
   END;
   ReWrite(OutFile);
   II:=0;
   FOR I:=1 TO FileSize(InFile) DO BEGIN
      Read(InFile,ZNAK);
      IF ORD(ZNAK)=155 THEN BEGIN Write(OutFile,F1);Write(OutFile,F2);INC(II);END
      ELSE Write(OutFile,ZNAK);
   END;
   Close(InFile);
   Close(OutFile);
   WriteLn;
   TextColor(LightRed);
   WriteLn('Convert is successuful');
   TextColor(White);WriteLn('Number Of Changes: ',II);
   TextColor(Color);WriteLn;
END.
