[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading to end-of-file

From: Christoph Mecklenbraeuker
Subject: Re: Reading to end-of-file
Date: Tue, 5 Sep 1995 17:50:05 +0200 (MET DST)

Hi Eyal, the following code would give you the number of lines in the
file on a UNIX Machine. (Sorry, if you happen to work with a different OS)
Maybe this is of help? I know, this is not really satisfactory, but would
show a way, how to avoid reading beyond the EOF mark of a text-file.

>>     filename = "try.dat";
>>     cmd = sprintf("nl %s | tail -1 | awk - '{print $1;}'",filename);
>>     N = sscanf(system(cmd),"%d");

all the best,

============= email: address@hidden =======================
Christoph Mecklenbraeuker             | 
Lehrstuhl f. Signaltheorie (IC 5/35)  | Tel: +49(234) 700 6119
Ruhr Universitaet Bochum              | Fax: +49(234) 709 4261
D-44780 Bochum, Germany               | 
======== =====

reply via email to

[Prev in Thread] Current Thread [Next in Thread]