{Catbyte v1.0 by xenion@libero.it } uses crt; var file1 : file of byte; file2 : text; byte0 : byte; num : longint; line80 : integer; function int2str(int : longint) : string; var str0,str1 : string; com0,mod1 : longint; begin mod1:=0; repeat com0:=-1; repeat com0:=com0+1 until (int-com0) mod 10 = 0; int:=(int-com0) div 10; mod1:=mod1+1; str0[mod1]:=chr(com0+48); until int=0; com0:=mod1; str1:=''; for mod1:=1 to mod1 do begin str1:=str1+' '; str1[mod1]:=str0[com0-mod1+1]; end; int2str:=str1; end; begin if paramcount < 1 then begin writeln; writeln('Catbyte v1.0 by xenion@libero.it'); writeln; writeln('File input in ottale nel file output'); writeln; writeln('$catbyte [inputfile] [outputfile]'); halt; end; if paramstr(1) = '-h' then begin assign(file1,ParamStr(2)); reset(file1); writeln('File : ',ParamStr(2),' ', filesize(file1),' bytes.'); writeln('FileSize : ',filesize(file1)); writeln; write('>'); num:=0; repeat num:=num+1; read(file1,byte0); write(chr(byte0)); until num=filesize(file1); writeln('<'); halt; end; assign(file1,ParamStr(1)); assign(file2,ParamStr(2)); reset(file1); rewrite(file2); writeln(file2,'File : ',ParamStr(1),' ', filesize(file1),' bytes.'); writeln(file2,'FileSize : ',filesize(file1)); writeln(file2); line80:=0; writeln('Working...'); for num:=1 to filesize(file1) do begin read(file1,byte0); line80:=line80+length(int2str(byte0))+1; if line80 >= 75 then begin writeln(file2); line80:=length( (int2str(byte0)) )+1; end; write(file2,int2str(byte0),'.'); end; close(file1); writeln('K'); end.