Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从文件中删除所有多字节字符,我不知道它们是什么,所以我需要覆盖整个范围。
我可以像这样使用 grep 找到它们: grep -P "[\x80-\xFF]" 'myfile'
试图用 sed 做一个类似的事情,但是删除它们。
干杯
试试这个:
LANG=C sed 's/[\x80-\xFF]//g' filename
您可以使用iconv从一种编码转换为另一种