0

I want to edit a file using Notepad++, in such a way that I can replace a line containing a specific word, For example :

    edit 792
set name "XXXXX"
set action accept
next
    edit 957
set name "YYYYY"
set action accept
next
    edit 021
set name "ZZZZZ"
set action accept
next

I want to change it to :

    edit 0
set name "XXXXX"
set action accept
next
    edit 0
set name "YYYYY"
set action accept
next
    edit 0
set name "ZZZZZ"
set action accept
next

I would like to replace the "edit 792 or edit 957 or edit 021" and change it to "edit 0"

Do any ideas on how this can be done using Notepad++?

Thanks everybody.

Hopefully, I can get suggestions for solving this issue.

2 Answers2

0

You can choose the regular expression mode for replace, and then the target text you are searching should be edit \d+ which means are looking for anything like edit xyz where xyz are some digits. And you replace them with edit 0

API
  • 480
  • 3
  • 10
  • @thirteentwelve Please upvote and accept my answer if you think it solves your problem. Thanks. – API Nov 04 '22 at 08:15
0

I suggest you learn to use Edit -> Column Editor (Alt+c) to insert a column of ascending numbers.

Then, learn to use Alt+MouseMovement to select rectangles, and gain skill with rectangular cut/copy/paste operations.

When working with rectangles, these are also helpful:

Shift+Alt+ArrowKey to adjust dimension Shift+Alt+LeftMouseClick to specify opposite corner of a rectangle whose other corner is current caret position If your data is as uniform as shown, a sequence using the above operations will do what you want, although you may need to handle 1, 2 and 3 digit sections separately.

To review some creative solutions to rectangular text problems, use the magnifier icon and search this site for terms like “column editor rectangle paste”.

Drop a follow-up comment to indicate whether you succeeded.

#android_studio