【问题标题】:Would like to insert a line break after every number in Notepad++ (or excel, or Word)想在 Notepad++(或 Excel 或 Word)中的每个数字后插入换行符
【发布时间】:2025-11-26 06:45:01
【问题描述】:

我已经对一本书的索引进行了 OCRed 操作,除了无法识别某些换行符之外,它运行良好。我想扫描大量书籍的索引,因此需要在使用 Notepad ++ 时添加换行符。

我已经在查找和替换中尝试过:

  • 查找内容:[0-9]+
  • 替换为:\r\n

这几乎做到了我想要的,但它删除了数字。

我想要做的更多的是“查找数字并在它们之后插入换行符”。

如果有任何帮助,我将不胜感激!谢谢!

这是之前的索引示例:

Bengali-style baked fish 77 biscuits: fennel seed drop-biscuits 155 bread: naan 129 roti 127 simple layered flat breads 126 broad bean thoran 112 burgers: chicken burger 43

以及我希望它如何照顾:

Bengali-style baked fish 77 
biscuits: fennel seed drop-biscuits 155 
bread: naan 129 
roti 127 
simple layered flat breads 126 
broad bean thoran 112 
burgers: chicken burger 43 

【问题讨论】:

    标签: indexing insert notepad++ line ocr


    【解决方案1】:

    使用记事本++

    • Ctrl+H
    • 查找内容:\d+ \K
    • 替换为:\n\r\n(对于 Windows EOL)
    • 检查 环绕
    • CHECK 正则表达式
    • 全部替换

    说明:

    \d+         # 1 or more digits and a space
    \K          # forget all we have seen until this position
    

    截图:

    【讨论】:

    • 天哪。有用。有用!!!!!!非常非常非常感谢!这成就了我的一周。谢谢:-)
    • @kathaurielle:不客气,很高兴它有帮助,请随时将答案标记为已接受,How to accept an answer