Reputation: 123
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
Upvotes: 4
Views: 35908
Reputation: 1
Set search mode "Regular expression"
Find what: ^Ore\(DIAMOND_ORE.*
Replace with: Ore\(DIAMOND_ORE,1,1,1,0,5,STONE\)
Upvotes: 0
Reputation: 29240
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:
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.
Upvotes: 16