Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a book – all on one line – joined like this example in Notepad++:

<In the beginning God created the heaven and the earth.><And the earth was without form, and void and darkness [was] upon the face of the deep. And the Spirit of God moved upon the face of the waters.><And God said, Let there be light and there was light.><And God saw the light, that [it was] good and God divided the light from the darkness.>

Applying these find/replace rules I tried to get each line on its own, like below, but it did not convert.

  1. Find: (\d+)
  2. Replace \n$1
  3. Wrap around checked
  4. Search Mode: Regular expression
  5. Direction: Down
  6. No Transparency

Any suggestion?

<In the beginning God created the heaven and the earth.>
<And the earth was without form, and void and darkness [was] upon the face of the deep. And the Spirit of God moved upon the face of the waters.>
<And God said, Let there be light and there was light.>
<And God saw the light, that [it was] good and God divided the light from the darkness.> 
share|improve this question
2  
Please learn how to format posts and use the preview window (that's conveniently placed below the editor). – slhck Feb 12 '13 at 21:19

The problem is that you've simply used the rule that was suggested to you in a previous question of yours without adapting it to your new text. You're searching for digits (\d) as line delimiters – but in your book, there aren't any digits.

Your text lines are delimited by < at the beginning. So, if you wanted to use regular expressions, you'd need to search for these instead of digits:

  • Find: (<)
  • Replace: \n\1

You could also do the following:

  • Find ><
  • Replace: \n

Here, you wouldn't need regular expressions at all, which should be a little faster when replacing lots of text (which I'm assuming there is in your book).

Also note that the (<) expression will apply to any occurrence of a <, which would break the formatting if there were any < interspersed with the text. The >< replacement is safer in that regard since it's very unlikely for this combination to occur.

share|improve this answer
    
+1 for the last line of your answer. No Regex needed at all for this simple of a replacement. – techturtle Feb 12 '13 at 21:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .