提取损坏的字符串
我收到了一个怪异编码的文件,想知道是否有任何办法 检查“损坏”字符串。例如,
dat <- c("天脊煤化工集团股份有é\231\220å…¬å\217¸", "AB \"\"Achema\"\"",
"Abu Qir Fertilizers & Chemical", "Abu Zaabal Fertilizer &",
"ADP - Adubos De Portugal SA")
上面向量中的1和2元素被损坏,因为它们中有字符串和逃脱字符。我如何在vector dat
中过滤或生成损坏字符串的索引
I received a file that had a weird encoding and wondered if there's any way to
check for 'corrupted' strings. For e.g.
dat <- c("天脊煤化工集团股份有é\231\220å…¬å\217¸", "AB \"\"Achema\"\"",
"Abu Qir Fertilizers & Chemical", "Abu Zaabal Fertilizer &",
"ADP - Adubos De Portugal SA")
The 1 and 2 element in above vector are corrupted since they have strings and escape characters in them. How can I filter these out or generate an index of corrupted strings in the vector dat
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请尝试此尝试
如果您不想空的角色使用,
Try this
if you don't want empty character use