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'm trying to automatically globally search through a file in a Windows system and replace certain strings with the found string, plus a carriage return (^r^n, or something like that). Here is what I'm using, but it doesn't work.

s/\d\+\./&^M/g

In other words, I want to open up a new line following every occurrence of the string. Any ideas? Also, ^r^n may be overkill. I just want a windows-style new-line.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You want \r

s/\d\+\./&\r/g

I'm unsure what you expect to be matched by \d\+\. - a series of digits followed by a literal period (AKA full stop) or decimal point.

share|improve this answer
add comment

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.