Re: Problem reading data from a file (encounter EOF after second last record)
- From: Terence <tbwright@xxxxxxxxx>
- Date: Tue, 29 Jan 2008 12:17:34 -0800 (PST)
On Jan 30, 5:59 am, nure...@xxxxxxxxx wrote:
Hi Arjen,
Thanks for the post. The file which I am having trouble reading seem
not to have the new line character beyond the last record (in notepad
cursor does not go beyond the last record in the problematic file
whereas in others once clicked the cursor can go one line below the
last record). Now I manually insert a line at the end of the file, and
I can proceed with debugging. However, it is not convenient and
certainly not suitable beyond debugging. Given the problematic file,
how can I insert a new line character beyond the last record
programmatically? Any suggestions?
Regards,
Nure
This posting data shows that the file ends in #1A and not #0D #0A #1A
as would be expected.
DOS files will usually have the remaining sector space filled with
#1A, and depending on the application that wrote the file, the file
length will be exact, or else the rounded-up byte count to a sector
boundary. The file length is not considered to include the first #1A
generated, only those actually written as data bytes.
EDIT has the habit of writting an EXTRA #0D #0A after what you hoped
was the last line, before thw final #1A, This has caused me grief in
the past
.
- References:
- Prev by Date: Re: Problem reading data from a file (encounter EOF after second last record)
- Next by Date: Re: Problem reading data from a file (encounter EOF after second last record)
- Previous by thread: Re: Problem reading data from a file (encounter EOF after second last record)
- Next by thread: Re: Problem reading data from a file (encounter EOF after second last record)
- Index(es):
Relevant Pages
|
|