It looks like you are on UNIX. When you do this:
cmd file > file
where "cmd" is any UNIX command, you run the risk of "file" being overwritten by "> file" BEFORE it's read by "cmd file" so never do that.
Some tools like "sed" have options that allow "in-place" editing so the result of running that command on the input file is written back to that file. Most of them use temp files behind the scenes.
The safe, portable way to get the results of command written back to file is just to redirect the output to a tmp file and then move the temp file onto the original:
cmd file > tmp && mv tmp file
Safe, simple, and works for any command.
For your particular case of just looking for lines in a file that don't contain a particular word, the command you probably want is "grep" and you'd use it as:
grep -v acetate filename.txt > tmp && mv tmp filename.txt
For anything more complicated you'll probably want awk.