Is there a FREE utility out there for replacing blocks of text?

Something like notepad++'s find in files works for simple lines but in my case it's unusable since I need to target the entire block to avoid replacing the wrong thing and I also need to replace it with another block.

I've searched for similar questions but all seem to deal with line replacing not block replacing. :)

  • Can you give us a little more info? What type of files; text, Word, HTML? How many files are you talking about? – CharlieRB Feb 27 '12 at 13:35
  • @CharlieRB typical source file, complex copyright notice and other metadata, number of files I'd say hundreds – srcspider Feb 27 '12 at 13:38
  • 1
    There is an answer to this here. Please read the comments to get the explanation for notepad++ ability to do this. This is the same for replacing text. – CharlieRB Feb 27 '12 at 13:42
  • @CharlieRB that won't work, I need block replace and while notepad++ can get some sort of block replace though regular expression converting the actual block to a regular expression is a pain in the ass and on top of that notepad++ doesn't have support for the actual replacement text being a block; I've tryied several ways of doing it with it, doesn't work. Both the replaced and the new text are BLOCKS. – srcspider Feb 27 '12 at 13:51
  • Can you define what a "Block" of text is to you? To me, a block of text is just a group of sequential lines (and line-breaks). You may just have to sit down and write that "pain in the ass" RegEx. :) – Ƭᴇcʜιᴇ007 Feb 27 '12 at 13:54

A google search for "replace in files" lead me to a couple good looking solutions

http://www.emurasoft.com/replall/ http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/find_replace.html

I also recall windows grep doing this - http://www.wingrep.com/ though I don't have it installed at the moment.

  • replall is "per line" not "per block" wingrep is "per line" as well; pretty sure ultraedit was too – srcspider Feb 27 '12 at 13:22
  • I know wingrep will do multiline, and I'm pretty sure ultraedit will too. You should be able to copy paste into the box. Worst case scenario you can use \n's to represent newlines. – Jody Feb 27 '12 at 14:38
  • managed to get it working from the discussion in the comments on the question. But thanks anyway! :) – srcspider Feb 27 '12 at 18:15

Try EditPad Lite. It has multiple line functionality.

  • -1 he said MULTIPLE FILES. (not just multiple lines) Powergrep(also by JGsoft) would do it. I'm pretty sure that Editpad won't. Editpad is for individual files.. and is fantastic for it. Powergrep would do multiple. I doubt powergrep has a free version though. – barlop Feb 22 '14 at 20:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.