Esperando que este codigo te pueda ayudar. Saludos.
Código Delphi
[-]
uses pant7;
var
arcs,arch:text;
dias,mess,anos,hors,mins,temps,strt2,strt1:string;
dia,mes,ano,hor,min,temp:integer;
err1:word;
Begin
If Exist('arch1.txt') Then
Begin
assign(arch,'arch1.txt');Reset(arch);
assign(arcs,'arch2.txt');Rewrite(arcs);
repeat
readln(arch,strt1);
strt2:=copy(strt1,1,pos(' ',strt1)-1);
val(strt2,temp,err1);
strt1:=copy(strt1,pos(' ',strt1)+1,length(strt1));
val(copy(strt1, 1,2),dia,err1);
val(copy(strt1, 4,2),mes,err1);
val(copy(strt1, 7,4),ano,err1);
val(copy(strt1,11,2),hor,err1);
val(copy(strt1,14,2),min,err1);
str(temp,temps);
if temp<=9 then temps:='00'+temps
else if temp<=99 then temps:='0'+temps;
str(mes,mess);if mes<=9 then mess:='0'+mess;
str(dia,dias);if dia<=9 then dias:='0'+dias;
str(ano,anos);
str(hor,hors);if hor<=9 then hors:='0'+hors;
str(min,mins);if min<=9 then mins:='0'+mins;
writeln(temps+' '+dias+'/'+mess+'/'+anos+' '+hors+':'+mins);
writeln(arcs,temps+' '+dias+'/'+mess+'/'+anos+' '+hors+':'+mins);
until Eof(arch);
close(arch);
close(arcs);
end
Else Begin writeln('error. no existe el archivo arch1.txt'); End;
End.
102 06/02/2014 5:57
19 06/02/2014 6:07
8 06/02/2014 8:25
06/02/2014 5:57
06/02/2014 6:07
06/02/2014 8:25
12345678901234567890