DonationCoder.com Forum

Main Area and Open Discussion => General Software Discussion => Topic started by: kalos on February 29, 2008, 10:16 AM

Title: replace text blocks
Post by: kalos on February 29, 2008, 10:16 AM
hello

can you tell me please a program that will batch replace text blocks in multiple files?

I know there are numerous that replace text, but I don;t know any for whole blocks of text (multi-line text, paragraph text)

also it should work with other than english characters


thanks
Title: Re: replace text blocks
Post by: f0dder on February 29, 2008, 06:43 PM
What are the restrictions on the text blocks you want to replace? What kind of input format (raw .txt files, XML, ...) , what are the precise criteria of the text you want to replace, etc.

Probably some unicode-aware regular-expression text replacer can do the job.
Title: Re: replace text blocks
Post by: kalos on February 29, 2008, 06:50 PM
I want to delete eg this text:
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>

<hr class="hidden" />
<table id="footer" width="100%">
<tr>
<td>&copy;

the files are html (that can obviously be considered as txt)

yes, a regex replacer would do that, but it's hard for me to turn the whole text block into single-line regex text, I just need to copy-paste the text block to the application :D


edit by jgpaiva: fixed code tag
Title: Re: replace text blocks
Post by: f0dder on February 29, 2008, 06:58 PM
Ah, so it's static blocks you want to replace? 100% exact, not even variety in ChArEcTEr CaSe?
Title: Re: replace text blocks
Post by: kalos on February 29, 2008, 07:09 PM
yeap, exactly

I found "ALIAS Find and Replace" that supposedly does the job, but somehow it doesn't install on my pc
Title: Re: replace text blocks
Post by: Darwin on March 02, 2008, 08:31 AM
Although this recent thread: https://www.donationcoder.com/forum/index.php?topic=12142.0 started as a request for a DC discount on PowerGrep (http://www.powergrep.com/), a number of alternatives - FOSS and shareware - were suggested. You'll probably find something there. In addition, there are a number of threads on this forum dealing with similar needs. Here is a small sampling of them:

https://www.donationcoder.com/forum/index.php?topic=9401.0
https://www.donationcoder.com/forum/index.php?topic=8612.0
https://www.donationcoder.com/forum/index.php?topic=5678.0
https://www.donationcoder.com/forum/index.php?topic=2929.0
https://www.donationcoder.com/forum/index.php?topic=11013.0





Title: Re: replace text blocks
Post by: Renegade on March 02, 2008, 08:50 AM
PowerGrep will certainly do it, but is perhaps overkill for most people.

Most decent text editors will do this. Editplus does. Just use the "Replace in files" function. (Or whatever it's called --- similar to that anyways.)
Title: Re: replace text blocks
Post by: sri on March 02, 2008, 09:02 AM
http://www.orbit.org/replace/