Pascal/Turbo Pascal - DUDA SOBRE ARCHIVOS

 
Vista:

DUDA SOBRE ARCHIVOS

Publicado por VICTOR (2 intervenciones) el 08/01/2003 01:10:08
HOLA AMIGOS
MI DUDA ES LA SIGUIENTE DESEO LEER UN ARCHIVO Y CONTAR LA LINEAS QUE EL ARCHIVO TENGA
¿COMO LO HAGO?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:DUDA SOBRE ARCHIVOS

Publicado por Diego Romero (786 intervenciones) el 08/01/2003 07:53:21
Supongo que te refieres a un archivo de texto, entonces:
var
F:Text;
ContLineas:Integer;
S:String;
begin
Assign(F,'texto.txt');
Reset(F);
ContLineas:=0;
ReadLn(F,S);
while not Eof(F) do
begin
inc(ContLineas);
ReadLn(F,S);
end;
Close(F);
WriteLn('El Archivo contiene ',ConLineas,' líneas.');
end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:GRACIAS

Publicado por VICTOR (2 intervenciones) el 09/01/2003 01:56:02
VALE TE PASASTE
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar