Re: Reading text file characters
From: Bob O`Bob (filterbob_at_yahoogroups.com)
Date: 12/28/04
- Next message: Larry Serflaten: "Re: View Text File using VB6"
- Previous message: Rick: "Re: sstab CONTROL"
- In reply to: Don: "Re: Reading text file characters"
- Next in thread: Jim Mack: "Re: Reading text file characters"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Dec 2004 12:37:48 -0800
Don wrote:
> I had suspected this was the EOF or at least the result of an EOF
> since it always occurred at the end of a file - well, almost always.
> You bring up an interesting point regarding the overwriting of excess
> EOF markers. Where I have seen the ^@ midway through a file, it would
> usually be where there was some copying and pasting. But if that's
> the case, I didn't think an EOF could actually appear midway in a file
> and still allow the user to move beyond that point, which I can do.
> On the other hand, we have had problems in the past where text
> suddenly ends, but using a variety of maneuvering procedures (e.g.
> PgDn or CTRL/END or whatever to get past that point, I have sometimes
> actually reached text that at first was not visible. Now I'm
> wondering if, based on your description of traling EOFs, if I'm
> running into text that has somehow managed to be placed between EOFs,
> which should not happen, if I understand the purpose of the EOF
> correctly.
The purpose of the EOF character varies somewhat, with use.
Since it's just another byte value, many non-text files will contain any
number of instances of it, and in that context it means nothing special.
Many text-based applications will treat it as an EOF, and will not read
farther into a file containing one. It should be obvious that such
text-based applications shouldn't be writing it out, with the possible
excuse being when there's nothing following it except more EOF characters.
> But since you identified the ^@ as a null byte, maybe when I'm
> deleting it, I'm really deleting more than that - some of those EOFs,
> if that's possible????
Depending on how you open or read the file, you may be doing something
analogous to masking it out, so when you write, it doesn't come through.
> As long as I can fix these problems with my app, that may be good
> enough, but I'd sure like to be able to tell the programmers who
> produce this program where they can concentrate in their program to
> prevent the problem from even happening in the first place.
You might suggest they should only write _printable text characters_ to
their files. Or else admit that they're not quite "text" files.
Bob
- Next message: Larry Serflaten: "Re: View Text File using VB6"
- Previous message: Rick: "Re: sstab CONTROL"
- In reply to: Don: "Re: Reading text file characters"
- Next in thread: Jim Mack: "Re: Reading text file characters"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|