Notepad++ Replace all lines starting with

22,627

The search regex you want is ^Ore\(DIAMOND_ORE.*

The ^ character means match the beginning of a line and the .* means match any character any number of times.

For a single file you can use the simple search and replace feature.

Make sure the find and replace box has Regular Expressions checked and that . matches newline is not checked.

Then set your replacement text to

Ore\(DIAMOND_ORE,1,1,1,0,5,STONE\)

Your search and replace box should look like this:

enter image description here

Hit Replace All. Done.

I have 320 files containing that but with other params

If you have multiple files to process, just click on the Find in Files tab and set your filter and directory, and then hit Replace in Files. I recommend you back-up your target files first though.

Share:
22,627
Martini002
Author by

Martini002

Updated on September 21, 2020

Comments

  • Martini002
    Martini002 over 3 years

    Here is the original line:

    Ore(DIAMOND_ORE,7,1,100.0,0,16,STONE)
    

    I have 320 files containing that but with other params, I just want to search for:

    Ore(DIAMOND_ORE
    

    And replace the whole line by:

    Ore(DIAMOND_ORE,1,1,1,0,5,STONE)
    

    How can I do that?

    Thanks