Page 1 of 1

Trimming and editing this?

Posted: Sat Sep 20, 2014 2:02 pm
by terrypin
Struggling with this one in vain for an hour or so!

I want to turn text like this:


[center]
name=^1 01

[Center2Tile]
name=^1 02

[center4tile]
name=^1 03


into this:

center.ctf
Center2Tile.ctf
center4tile.ctf


I have actually achieved my goal but it took four separate runs and I can't relax until I find a more elegant solution!

--
Terry, East Grinstead, UK


--
Terry, East Grinstead, UK

Posted: Sat Sep 20, 2014 3:42 pm
by ak47wong
Here's one way to do it. I don't know if it qualifies as elegant, but hopefully it will help you relax!

Find what: \[(.*)\]\n.*\n
Replace with: $1.ctf

Posted: Sat Sep 20, 2014 3:53 pm
by terrypin
Excellent, thanks a bunch!

Final relaxation will have to wait until I've studied it carefully over a glass of wine this evening, to learn exactly how it works. ;-)

--
Terry, East Grinstead, UK