Exactly. Use Perl (or maybe Python).
sed is bullshit.
Do you know it is not actually possible to get output from sed that does not contain a newline?
sed is bullshit.
Do you know it is not actually possible to get output from sed that does not contain a newline?