<feff> character showing up in files when editing in vim. How to remove them.

The vim method did not work. The awk recipe only removes <U+FEFF> (or as it is shown in vim) from the first column. I modified it to remove ALL <U+FEFF>

awk '{ gsub(/\xef\xbb\xbf/,""); print }' INFILE > OUTFILE

或者使用这个sed命令

#sed -i.bak 's/\xef\xbb\xbf//g' YSBLF.subtitles.all.srt

来源:https://gist.github.com/szydan/b225749445b3602083ed

 

更多信息来源:

https://stackoverflow.com/questions/1972362/why-is-my-bash-script-adding-feff-to-the-beginning-of-files

posted @ 2024-04-11 19:42  profesor  阅读(27)  评论(0)    收藏  举报