如何从终端中的一堆文本文件中删除 Unicode 字符?
我已经试过了,但是没用:
sed 'g/\u'U+200E'//' -i *.txt
我需要从文本文件中删除这些 Unicode 字符:
U+0091 - sort of weird "control" space
U+0092 - same sort of weird "control" space
A0 - non-space break
U+200E - left to right mark
最佳答案
清除file.txt
的所有非ASCII字符:
$ iconv -c -f utf-8 -t ascii file.txt
$ strings file.txt
选项:
-c # discard unconvertible characters
-f # from ENCODING
-t # to ENCODING
关于bash - 从文本文件中删除 Unicode 字符 - sed ,其他 Bash/shell 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8562354/