Indeed, ‘tr’ translates, squeezes, and/or delete *characters*. sed's s command substitutes strings. To substitute a sequence of literal "\n" or "\t" with one single tabulation (is this what you want?):
$ sed 's/\\[nt]\(\\[nt]\)*/\t/g'

Reply via email to