Program join first line of files FirstT.txt a SecondT.txt result write to file ResultT.txt
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Author: Juraj Pupák
Program: Subor_sp.pas
File exe: Subor_sp.exe
need: Firstt.txt, Secondt.txt
Author: Juraj Pupák
Program: Subor_sp.pas
File exe: Subor_sp.exe
need: Firstt.txt, Secondt.txt
Program join first line of files FirstT.txt a SecondT.txt result write to file ResultT.txt.
{ SUBOR_SP.PAS } { Program zluci prve riadky suborov FirstT.txt a SecondT.txt } { do suboru ResultT.txt } { } { Author: Juraj Pupak } { Date : 27.10.2006 http://www.trsek.com } program Subor_SpojenieSuborov; uses crt; var Tsubor,Tsubor_1,Tsubor_2 : Text; Cstr_Vysledny,Cstr_1,Cstr_2 : string; begin clrscr; writeln('Program zluci prve riadky suborov FirstT.txt a SecondT.txt'); writeln('do suboru ResultT.txt.'); Assign(Tsubor_1,'FirstT.txt'); Reset(Tsubor_1); while not Eof(Tsubor_1) Do begin Readln(Tsubor_1,Cstr_1); end; Assign(Tsubor_2,'SecondT.txt'); Reset(Tsubor_2); while not Eof(Tsubor_2) Do begin Readln(Tsubor_2,Cstr_2); end; Cstr_Vysledny := Cstr_1 + Cstr_2; Assign(Tsubor,'ResultT.txt'); Rewrite(Tsubor); writeln(Tsubor,Cstr_Vysledny); Close(Tsubor); readln; end.