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.

Original text:

2###
Test 123

I am doing this operation:

Find what: 2###
Replace with: 2###\r\nText before 

Result:

2###
Text before
Test 123

Desired result:

2###
Text before Test 123

For some reason it adds a new-line after the replaced text. It seem to only happen when I add \r\n or \n in the Replace with.

How can I set it up so it does not insert this newline?

share|improve this question
11  
+1 for question in the form of: Input, program(sure, you could call it a program), output, expected output. –  Cruncher May 27 at 18:08

1 Answer 1

up vote 27 down vote accepted

Line 1 is actually 2###<new line>.

You are replacing 2### with 2###<newline>Text before, making the line (in effect) into 2###<newline>Text before<newline>.

You need to include the new line you want to replace in your search.

Find: 2###\r\n
Replace with: 2###\r\nText before

share|improve this answer
    
Thank you very much! Now it seems very obvious to me :) –  Kaah May 27 at 16:45

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.