给定一个在专用区域中包含字符的文件,如下所示:
$ cat textfile.txt | less
10 翴 30 <U+E4D1> ten-thirty in ... three ... two ... one .
- 10 翴 45だи<U+E145>砆 秂 <U+E18E> it 's a slam-dunk .
<U+E707> 10 翴 <U+E6C4>ㄓ ? so you will be home by 10:00 ?
10 翴 牧 よ<U+E6BC>ㄓ<U+E5EC> bogey at 10 o'clock .
- 10 翴 牧 よ<U+E6BC>い盠 - ten o'clock , lieutenant , 10 o'clock !
10 翴 牧 よ<U+E6BC>绰玭 i see it , 8 o'clock , heading south !
10 翴 筁<U+E5EC> it 's past 10:00 .
<U+E80B>ぱ 10 翴 非<U+E1A0>筁ㄓ be here tomorrow , 10:00 sharp .
- 10 , 老搭档 有 人 开枪 , 疑犯 拒捕 shots firing . suspect 's fleeing .
- 1 -0 而已 - only 1-0 .
- 1 -0 而已 - only 1-0 .
如果有任何字符超出了unicode字节点,如何删除行?
我试过了:
^{pr2}$但我似乎无法摆脱包含PUA字符的行。在
如何在unixsbash中使用sed/awk或其他东西而不是使用Python实现相同的目标?
请注意,我仍然希望保留unicode有效的行,而不仅仅是使用ascii字符的行。E、 我想保留最后三行的汉字和“。。。开枪射击。(由于某种原因,我无法在问题中键入中文部分,因为显示汉字错误。)
检查字符是否属于private use area的条件(
ord(i) > 57344
)不正确:以下是修复的Python 3代码:
此grep命令将匹配U+E000–U+F8FF范围内不包含PUA字符的任何行:
相关问题 更多 >
编程相关推荐