My 20c in here:
If the file is structured in lines maybe you could do this
pen the file r/w, read it line by line, compare the line with whatever string you want; when found, fseek to the line's position-1, write the desired line, fseek to the new location then write the rest of the lines skipping the one found.
edit: maybe it's not clear what I said above but of course you'll have to use a temporary file which then can be renamed to the original file, previously deleted.