topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday December 12, 2024, 4:24 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: replace text blocks  (Read 7385 times)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
replace text blocks
« 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
« Last Edit: February 29, 2008, 11:40 AM by kalos »

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: replace text blocks
« Reply #1 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.
- carpe noctem

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: replace text blocks
« Reply #2 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
« Last Edit: February 29, 2008, 07:28 PM by jgpaiva »

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: replace text blocks
« Reply #3 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?
- carpe noctem

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: replace text blocks
« Reply #4 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

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: replace text blocks
« Reply #5 on: March 02, 2008, 08:31 AM »
Although this recent thread: https://www.donation...ex.php?topic=12142.0 started as a request for a DC discount on PowerGrep, 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.donation...dex.php?topic=9401.0
https://www.donation...dex.php?topic=8612.0
https://www.donation...dex.php?topic=5678.0
https://www.donation...dex.php?topic=2929.0
https://www.donation...ex.php?topic=11013.0






Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: replace text blocks
« Reply #6 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.)
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

sri

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 689
    • View Profile
    • Sridhar Katakam
    • Read more about this member.
    • Donate to Member
Re: replace text blocks
« Reply #7 on: March 02, 2008, 09:02 AM »
<a href="https://sridharkatakam.com">My blog</a>
« Last Edit: March 02, 2008, 09:12 AM by sri »