Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have some text in this format all on 1 line:

1v YHWH said, Let us make man in our image, after our likeness, and God created man in his own image. 2v And God formed man from the ground, and he blew into his nostrils the breath of life, and man became a living soul endowed with speech. 3v And the Lord said, It is not good for man to be alone; I will make unto him a helpmeet. 4v And the Lord caused a deep sleep to fall upon Adam, and he slept, and he took away one of his ribs, and he built flesh upon it, and formed it and brought it to Adam, and Adam awoke from his sleep, and behold a woman was standing before him. 5v And he said, This is a bone of my bones and it shall be called woman, for this has been taken from man; and Adam called her name Eve, for she was the mother of all living.

I want to look like this:

1v YHWH said, Let us make man in our image, after our likeness, and God created man in his own image.
2v And God formed man from the ground, and he blew into his nostrils the breath of life, and man became a living soul endowed with speech.
3v And the Lord said, It is not good for man to be alone; I will make unto him a helpmeet.
4v And the Lord caused a deep sleep to fall upon Adam, and he slept, and he took away one of his ribs, and he built flesh upon it, and formed it and brought it to Adam, and Adam awoke from his sleep, and behold a woman was standing before him.
5v And he said, This is a bone of my bones and it shall be called woman, for this has been taken from man; and Adam called her name Eve, for she was the mother of all living.

I did a regular expression replace like Find: "(\d+)" Replace: "\n$1"
I tried a bunch different ways like: --wrap around-regular expression --down [cursor at end]

This would get all the verses in order but it would change all the verse numbers to 1?

share|improve this question
    
What is your question? –  Shinrai Nov 8 '11 at 17:51
    
Since it's windows it kind of depends on what editor you use. –  Nifle Nov 8 '11 at 17:57
    
Did you forget the newline before 4v? –  Daniel Beck Nov 8 '11 at 19:57

2 Answers 2

If you install Notepad++, you can use regular expressions in its Replace with function. Your attempt is almost correct.

  • Find what: (\d+)v
  • Replace with: \n\1v

Note that I used \1 instead of $1.

enter image description here

share|improve this answer
2  
I get more respect for Notepad++ every day –  Ivo Flipse Nov 8 '11 at 19:53
1  
Scintilla Text Editor handles RegExp too. –  music2myear Nov 8 '11 at 21:51
1  
yeah I've done similar split operations with N++, FTW! –  Sathya Nov 10 '11 at 7:05

If you like to work from the command line, using sed, this is simply:

C:\> sed -i 's/\([0-9]\+\)v/\n\1/g' path\to\yourfile.txt
share|improve this answer
    
I'll add my upvote if you edit your question to include how to install sed for windows. –  Nifle Nov 11 '11 at 19:01
    
Met you halfway, by including a link for sed for Windows. Personally, I use Cygwin, but that seems like overkill (and certainly no easier than installing NPP.) –  Eric Wilson Nov 11 '11 at 19:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.