Re: Problem reading data from a file (encounter EOF after second last record)



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
.



Relevant Pages

  • Re: Problem reading data from a file (encounter EOF after second last record)
    ... 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 ... I can proceed with debugging. ...
    (comp.lang.fortran)
  • Re: (repost): Very tough question, about HTML manipulation
    ... You need to be able to apply a regular expression to chunks of text, so I can see why my individual character method would not work. ... Again create a Cursor and Reference Range. ...
    (microsoft.public.scripting.jscript)
  • Re: Virus Symptoms ?
    ... key) and the delete key deleted all the charcaters back to the cursor. ... Also, arrow keys move, yes. ... backspace to delete the incorrect character ... and type the correction to insert. ...
    (microsoft.public.windowsxp.basics)
  • Re: column count in VB6
    ... > is supposed to return me the current, I guess current Character count ... > The .getcurrentcolumnnumber does that, but stops after I go off the ... RichTextBox if the references are changed appropriately (TextBox to ... also gives the column that the cursor is in. ...
    (microsoft.public.vb.general.discussion)
  • OT: Editor like CygnusEd on Amiga
    ... Can anyone give me a recommendation about an editor that is as close as ... the cursor character by character. ... Turbo does not scroll at all, ...
    (Fedora)