> Actually what I try to do is to replace  one string with another string
> in some FACS data files, in which part of them are headers in text
> format and the rest of them in binary format. For example replace "CD3"
> with "CD4" or "CD45". If it is the first case the new file is of same
> size and I can open the new file without losing the image information
> but I will lost all the image information if I replace "CD3" with
> "CD45". This is what I mean by unpreditable result.

It sounds like there's some sort of index at the beginning of the file
you're changing. E.g. at the beginning of the file it says: 3 bytes of
data, followed by an image. If you substitute "CD3" for "CD45", you'd
also have to update the index at the beginning to say "4 bytes of
data, followed by an image".

I'm afraid I don't know FACS, but it sure sounds like the nature of
the file format doesn't allow you to just search and replace in the
file without updating some context information as well.
   -tim