简体   繁体   English

想在 Notepad++(或 excel 或 Word)中的每个数字后插入换行符

[英]Would like to insert a line break after every number in Notepad++ (or excel, or Word)

I've OCRed the index of a book, and it's worked well, apart from not recognising some line breaks.我已经对一本书的索引进行了 OCR 处理,效果很好,除了无法识别一些换行符。 I would like to scan the indexes a load of books, and so need to add line breaks in using Notepad ++, ideally.我想扫描大量书籍的索引,因此理想情况下需要在使用 Notepad ++ 时添加换行符。

I have tried this in Find and Replace:我在查找和替换中尝试过这个:

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

Which almost did what I want, but it removed the numbers.这几乎完成了我想要的,但它删除了数字。

it's more 'find numbers and insert line break after them' that I'm trying to do.我正在尝试做的更多是“查找数字并在它们之后插入换行符”。

I would be so grateful for any help!如有任何帮助,我将不胜感激! Thank you!谢谢!

Here's an example of the index before:这是之前的索引示例:

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

And how I'd like it to look after:以及我希望它如何照顾:

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 

Using Notepad++使用记事本++

  • Ctrl + H Ctrl + H
  • Find what: \\d+ \\K找出什么: \\d+ \\K
  • Replace with: \\n or \\r\\n for Windows EOL替换为: \\n\\r\\n对于 Windows EOL
  • CHECK Wrap around检查环绕
  • CHECK Regular expression检查正则表达式
  • Replace all全部替换

Explanation:解释:

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

Screenshot:截屏:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM