in reply to why does 'sed' remove the entire line?

I tried and I couldn't reproduce your problem.

One thing I can imagine could go wrong is that your output file sesip2 does contain what it should but you didn't see its contents correctly (either because it has no newline and your prompt has overwritten it or because it has extra carriage returns), so try printing it with this command:

cat -A sesip2 ; echo

Update: also please make sure that your system "sed line is after all the close commands.