|
On 6/1/2011 3:14 PM, Jonathan wrote:
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message
> <54d653b9-c969-4075-999b-050bb48221a8@w21g2000yqm.googlegroups.com>...
>> Are you sure it's not an EOF character instead of a line feed or
>> carriage return?
>
> It's a single 'character" that needs to exist at the end of the file. I
> am assuming it is an EOF character, but it's not clear how to generate
> it automatically using fprintf.
...
Oh, I got (apparently) sidetracked by assuming the title had something
to do w/ the subject...silly me! :)
First things first --
a) why does the existence of a special character at the file matter? In
general this "feature" has gone the was of the dodo.
b) if, for some reason, it is important, first thing to do is to find
out what the actual character(s) is(are). Easiest thing to do there is
to open a file w/ a binary editor and look.
c) once a) and b) are both known to be true and the output required
known, if it's something other than one of the special characters
fprintf knows about, I _think_(+) you'll have to write it w/ fwrite()
after the last fprintf() of regular text files.
(+) Caveat -- I don't recall if there's a C escape sequence in formatted
write to write an arbitrary byte in formatted write or not, or if there
is, if Matlab has it incorporated. My quick perusal doesn't indicate to
me there is but I may be overlooking it.
--
|