Unfortunately there are three problems: the "^t" escape for a tab character in a sed(1) regex is not sufficiently portable, the backslashes in the sed(1) command would have to be escaped against the surrounding double-quotes and the capturing regex also would capture trailing whitespaces. I see no portable and at the same time generic enough way to solve this with sed(1). Instead awk(1) works far more reasonable here.