find/replace how to replace with new line?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JoWi_3984961
Level 4
Level 4
First like received First like given

The regex applies to the fine what.

But suppose I wish to replace with more than one line? 

How to use fine/replace to replace for example,

ONE

with

ONE

TWO

THREE

1 Solution
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello John,

You can use Notepad++ in order to replace one word or line with more than one line.

In order to do his the steps are as follows:

1. Open the file where you want to make the changes using Notepad++. In case you want to make the changes in an entire document open Notepad++ and press Ctrl + F. There under the find in files tab give appropriate directory for the document.

pastedImage_1.png

2. In the Find What box, write the mane of the word you want to replace (#define ONE in this case)

3. Make sure the Search mode is set to Extended

4. In the replace with box type the text that you want the word to be replaced. Make sure to separate the words that you want in separate line are separated by \n (ONE\nTWO\nTHREE in this case)

5. Click on replace all.

6. Save the changes made.

When you will open the same file in PSoC Creator the desired changes would have been made.

pastedImage_8.png

Best Regards

Ekta

View solution in original post

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Trick: Write down your

ONE

TWO

THREE

Mark it, then coy it (ctl-c) and paste it into the replace item (ctl-v)

Bob.

0 Likes

And if you wish to use find/replace? Instead of wasting time?

0 Likes

You misunderstood me: You should paste it into the replace dialog window !!!

Bob

EDIT: Doesn't work for line break, sorry, no help

0 Likes

Tried that first thing

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello John,

You can use Notepad++ in order to replace one word or line with more than one line.

In order to do his the steps are as follows:

1. Open the file where you want to make the changes using Notepad++. In case you want to make the changes in an entire document open Notepad++ and press Ctrl + F. There under the find in files tab give appropriate directory for the document.

pastedImage_1.png

2. In the Find What box, write the mane of the word you want to replace (#define ONE in this case)

3. Make sure the Search mode is set to Extended

4. In the replace with box type the text that you want the word to be replaced. Make sure to separate the words that you want in separate line are separated by \n (ONE\nTWO\nTHREE in this case)

5. Click on replace all.

6. Save the changes made.

When you will open the same file in PSoC Creator the desired changes would have been made.

pastedImage_8.png

Best Regards

Ekta

0 Likes