0

I have about 40,000 lines I need to look like first line - no paragraph marks.

The trouble is, I can't use join lines then use (\d\D+)& $1\n to get like line 1 because of numbers inside of sentences.

Can anyone give any hints or tricks?

<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
Julian Knight
  • 14,749
  • 3
  • 31
  • 46
user83705
  • 103

1 Answers1

0

I'd do it in several steps.

If you want the <n to start a new line, I'd start by replacing /^ (\<\d+.*)/ with $1 (remove the leading space from lines starting <n).

Then I would replace /^(.*)\^p$/ with $1 (remove the ^p at the end of the line).

Then replace /^ \~(.*)/ with just a leading space.

Then it might be easiest to remove ALL newlines and finally split the lines wherever there is a <n: Replace /(\<\d+)/ with \n$1

Not actually tried this in NP++ though so treat with caution!

Julian Knight
  • 14,749
  • 3
  • 31
  • 46