Program join two txt file and save to thith file
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Author: Pheo
web: pascalsource.ic.cz
Program: Spojenie_suborov.pas
File exe: Spojenie_suborov.exe
need: Vstup1.txt, Vstup2.txt
Author: Pheo
web: pascalsource.ic.cz
Program: Spojenie_suborov.pas
File exe: Spojenie_suborov.exe
need: Vstup1.txt, Vstup2.txt
Program join two txt file and save to thith file.
{ SPOJENIE_SUBOROV.PAS Copyright (c) Pheo } { Program ktorý do tretieho súboru spojí text z dvoch súborov. } { } { Datum:06.04.2005 http://www.trsek.com } program spojenie_suborov; var c : char; s1, s2, s3 : text; begin assign(s1,'vstup1.txt'); reset(s1); assign(s2,'vstup2.txt'); reset(s2); assign(s3,'vystup.txt'); rewrite(s3); while not(eof(s1)) do begin while not(eoln(s1)) do begin read(s1,c); write(s3,c); end; readln(s1); writeln(s3); end; close(s1); while not(eof(s2)) do begin while not(eoln(s2)) do begin read(s2,c); write(s3,c); end; readln(s2); writeln(s3); end; close(s2); close(s3); writeln('Spojene vstup1.txt + vstup2.txt do vystup.txt.'); readln; ReadLn; end.