Display non-printing characters with cat and replace with sed

Got a csv file created with Open Office from a Microsoft Excel file. It contains characters which in less show up as "^K" (caret upper case K), which trip up the shell and vi. One way to get rid of them is to display them with "cat --show-nonprinting" and then replace with sed:

cat -v file | sed 's/\^K//g'

Leave a comment

NOTE: Enclose quotes in <blockquote></blockquote>. Enclose code in <pre lang="LANG"></pre> (where LANG is one of these).