1

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.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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