如何用第九位分隔文件

How to separate files by the ninth digit

我的想法是只保留第九位包含数字“8”的那些。

示例: 每行 11 个数字的数字列表

162156258 12 we keep this one because it's an "8" in the ninth position
612644264 75 this one would be deleted
621285076 89 this one would be deleted
872275028 72 this would be kept...

78686825079 
12801683230 
87545141857 
46821584818 
51704231523 
15256375253 
60512053812 
85746520080 
80014785137 
46648611847

是否可以在记事本中执行此操作?有没有我可以做的网站?我怎么能那样做?谢谢大家

使用记事本++

  • Ctrl+H
  • 查找内容:^\d{8}[^8].*\R?
  • 替换为:LEAVE EMPTY
  • 检查 环绕
  • 检查 正则表达式
  • 取消选中 . matches newline
  • 全部替换

解释:

^           # beginning of line
\d{8}       # 8 digits
[^8]        # a character that is not "8"
.*          # 0 or more any character
\R?         # any kind of linebreak, optional

屏幕截图(之前):

截图(之后):