W. eWatson a écrit :
Fredrik Lundh wrote:
W. eWatson wrote:
I have an ordinary text file with a CR at the end of a line, and two
numbers in each line. Is there some way to determine the number of
lines (records) in the file before I begin reading it?
In the general case, no. A file is just
W. eWatson a écrit :
I have an ordinary text file with a CR at the end of a line, and two
numbers in each line. Is there some way to determine the number of lines
(records) in the file before I begin reading it?
How could you know how many times a given character appears in file
without readi
Fredrik Lundh wrote:
W. eWatson wrote:
I have an ordinary text file with a CR at the end of a line, and two
numbers in each line. Is there some way to determine the number of
lines (records) in the file before I begin reading it?
In the general case, no. A file is just a bunch of bytes. If
On 23.08.2008, W. eWatson <[EMAIL PROTECTED]> wroted:
> Maybe. I could see it if the file were truly in a record format. The # of
> records might be kept by the OS. It's conceivable that Python or the OS
> might see a file with a CR as "recordized".
Isn't it much easier to use a database inste
Nick Dumas wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Err...you want to know what is in a file before you open it? This could
be done if you keep some external database documenting changes made to
the file. But unless I misunderstand what you're saying, then it's not
possible to know t
W. eWatson wrote:
I have an ordinary text file with a CR at the end of a line, and two
numbers in each line. Is there some way to determine the number of lines
(records) in the file before I begin reading it?
In the general case, no. A file is just a bunch of bytes. If you know
that all li
On 2008-08-23, W. eWatson <[EMAIL PROTECTED]> wrote:
> I have an ordinary text file with a CR at the end of a line, and two numbers
> in each line. Is there some way to determine the number of lines (records)
> in the file before I begin reading it?
If the lines are fixed lengh (e.g. always 12
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Err...you want to know what is in a file before you open it? This could
be done if you keep some external database documenting changes made to
the file. But unless I misunderstand what you're saying, then it's not
possible to know the contents of a fil
I have an ordinary text file with a CR at the end of a line, and two numbers
in each line. Is there some way to determine the number of lines (records)
in the file before I begin reading it?
--
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
(121.015 Deg. W, 39