我有大约 40,000 行需要看起来像第一行 - 没有段落标记。
问题是,(\d\D+)& $1\n
由于句子内部有数字,我无法使用连接线然后用它来获得第 1 行。
有人可以提供一些提示或技巧吗?
<1IN THE beginning God (prepared,~formed, fashioned, and) created the~heavens
<2The earth was without form and an^p
~empty waste, and darkness was upon^p
~the face of the very great deep. The^p
~Spirit of God was moving (hovering,^p
~brooding) over the face of the waters.
<3And God said, #1 Let there be light; and^p
~there was light.^p
<4And God saw that the light was good^p
~(suitable, pleasant) and He approved it;^p
~and #2 God separated the light from the darkness.^p
<5And God called the light 1 Day, and the^p
~darkness He called Night. And #3 there^p
~was evening and there was morning,^p
~one day.^p
答案1
我会分几个步骤来完成。
如果您希望<n
以 开始新行,我建议先用 替换/^ (\<\d+.*)/
($1
从以 开头的行中删除前导空格<n
)。
然后我将替换/^(.*)\^p$/
为$1
(删除行尾的 ^p)。
然后/^ \~(.*)/
仅用前导空格替换。
然后,最简单的方法是删除所有换行符,并最终在有<n
: 的地方拆分行,替换/(\<\d+)/
为\n$1
但实际上并未在 NP++ 中尝试过,因此请谨慎对待!