Author Topic: How do I find one line with another 4 varying ones below it and replace all?  (Read 1271 times)

Yeah, so this issue is probably not all that complex but it's insanely difficult to word it so I can't google it.
Basically, I've got this several times inside of a .blb:

Code: [Select]
UV COORDS:
0.6 0.2
0.3 0.1
0.5 0.7
0.4 0.5

Now this varies about in the blb, one time it's this, another it's something like

Code: [Select]
UV COORDS:
0.3 0
0 0
0.001 0.1
0.5 0.2

And I want to replace ALL of those with the exact following:

Code: [Select]
UV COORDS:
0.5 0.5
0.5 0.5
0.5 0.5
0.5 0.5

So no matter what is on the 4 lines below 'UV COORDS:', I need it to become just 0.5's.
Is there any way to do this with any text editor? I'm currently using Notepad++. I'd do it manually but most .blb's I have are over 500 lines and some even over 5000, and I need to change 18 blbs in total.

Thanks in advance.

Sublime Text has a multi-cursor thing where you can type in multiple points at once. If you do a search for "UV COORDS:", press Find All (which highlights each case of it as separate cursors), then you can just move the cursors down using the arrow keys to select the whole line and replace them.

If you want, send me the .blb and ill do it for you. Although I recommend downloading and using sublime text.

Open the BLB in Sublime Text, or any text editor with regex replace. Open the Find & Replace dialog (Ctrl+H), set it up as in the following image and press Replace All.


Sublime Text has a multi-cursor thing where you can type in multiple points at once. If you do a search for "UV COORDS:", press Find All (which highlights each case of it as separate cursors), then you can just move the cursors down using the arrow keys to select the whole line and replace them.

If you want, send me the .blb and ill do it for you. Although I recommend downloading and using sublime text.
I'll do it myself since it's like 18 blbs. Thanks for the answer tho.

Open the BLB in Sublime Text, or any text editor with regex replace. Open the Find & Replace dialog (Ctrl+H), set it up as in the following image and press Replace All.


And thank you too.

P.S. just tested it and UV coords only have 2 values, not three so it should be like
UV COORDS:\n.*\n.*\n.*\n.*
UV COORDS:\n0.5 0.5\n0.5 0.5\n0.5 0.5\n0.5 0.5
« Last Edit: August 17, 2014, 01:58:12 PM by TheArmyGuy »