Since you just need to replace the space after the numbers with two newline characters, you can use this command:
sed 's/([0-9]) /1
/' <textfile >newfile
- substitute (the first) one digit followed by space with that same digit followed by two
.
this worked really well until it got to a line that read “1 John 1:1 something written here” then it split the line in the wrong spot. How can I account for this?
To account for lines having number and space before the name, we can include a letter and everything before the final digit in the pattern:
sed 's/([a-z].*[0-9]) /1
/' <textfile >newfile
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…