better sed command (thanks to sdumitriu)