Ineedyourhelp
Ineedyourhelp

Reputation: 11

Notepad++, replace two first lines

I need to replace some things. This is how the row looks like:

44;3lyl
44;3lyl
44;3lyl
44;3lyl
44;3lyl

This is how the row should look like:

33;3lyl
33;3lyl
33;3lyl
33;3lyl
33;3lyl

I want to replace the first two numbers of each line. Please help me with this.

Upvotes: 0

Views: 92

Answers (2)

Andrea
Andrea

Reputation: 12375

If you don't want to use regular expressions you can still achieve what you want using mouse and keyboard and the column mode edting function of Notepad++.

You start with:

enter image description here

Now you can select the first two columns of characters with the mouse keeping the Alt key on you keyboard pressed while dragging your mouse to select the area you need to replace (the first two columns).

Now your selection should look like this:

enter image description here

Finally you can type the new text, in your case: "33". Notepad++ will overwrite 44 with 33 in all the selected rows:

enter image description here

Upvotes: 1

Harkirat Saluja
Harkirat Saluja

Reputation: 8114

Press Ctrl+H ,then in find \d+(;.*) and in replace 33$1

Make sure Regex mode is on:

enter image description here

Upvotes: 3

Related Questions