Hey,
check out this editor. Its free and powerfull. Maby you can solve your problem by recording a macro.
Anyways, its worth a try.
notepad-plus.sourceforge.net/uk/site.htm

0xA5EA :-)