topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday April 18, 2024, 6:19 am
  • 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: Global Text Replacement  (Read 6930 times)

Kruskal

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 72
    • View Profile
    • Donate to Member
Global Text Replacement
« on: May 19, 2007, 02:52 PM »
I'd like a simple program that would replace all occurrences of a text string with another in all files in a directory.  I've looked around and could only find far more complex utilities with far larger prices.

Bells & Whistles: Options which I could do without:

Only process files with a given extension (or extensions or matching a pattern)
Process subfolders (or not)
Ignore case (or not)

Thanks -- Vincent

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: Global Text Replacement
« Reply #1 on: May 19, 2007, 03:13 PM »
Advanced Find and Replace 3 should be able to tackle this (albeit for a price! It's shareware). It's got more features than you're looking for but despite being shareware it's quite cheap ($29.99) for its category.

I'm sure someone here will come along soon, though, with a free/donationware alternative...

One other thought: there is V-Grep, which is postcardware (couldn't find a link to its homepage so Snapfiles will have to do...).

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Global Text Replacement
« Reply #2 on: May 19, 2007, 04:46 PM »
BK ReplaceM can do that you need. It takes a minute or so to understand the interface. Basically you define a group of files, then define phrases and their replacements, then you apply the operations on the group of files.

At its core, ReplaceEm is essentially a text search-and-replace program. However, unlike the search-replace functionality of a standard text editor, ReplaceEm is designed to operate on multiple files at once. And you need not only perform one search-replace operation per file -- you can setup a list of operations to perform. If different groups of files need to have different operations performed on them, this is no problem either. You can also specify a backup file for each file processed just incase the replace operation didn’t do exactly what you wanted.
100% Free!

Works well in practice though. You can also download a trial from Dreamweaver, it's find/replace utility can run on files in a directory (But it won't save them across sessions like BK ReplaceM does.

mwb1100

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,645
    • View Profile
    • Donate to Member
Re: Global Text Replacement
« Reply #3 on: May 19, 2007, 05:11 PM »
Just for completeness, I thnk sed should be mentioned (Win32 version is available in the UnxUtils package: http://sourceforge.n...es.php?group_id=9328).

It's a scriptable text editor from the Unix world.  It's not simple - quite the contrary - it can be a real bugger to figure out how to use.  But, it's free and there's a lot of resources in Google-space on how to use it.  However, I'd only suggest it if you want to set something up that needs to run repeatedly so a scripted solution would be necessary.

mrainey

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 439
    • View Profile
    • Website
    • Donate to Member
Re: Global Text Replacement
« Reply #4 on: May 19, 2007, 06:33 PM »
PSPad is a freeware Windows programming editor that has all the features you're looking for.

http://www.pspad.com/en/pspad.htm



searchinfiles.png
Software For Metalworking
http://closetolerancesoftware.com
« Last Edit: May 19, 2007, 06:35 PM by mrainey »

Kruskal

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 72
    • View Profile
    • Donate to Member
Re: Global Text Replacement
« Reply #5 on: May 19, 2007, 09:21 PM »
Thank so much!  I will try ReplaceEm and PSPad.  Sounds great.

Vincent

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: Global Text Replacement
« Reply #6 on: May 21, 2007, 01:11 PM »
Vincent - did you look at VGrep? I ask only because I decided to re-download it and take a look. It's got a very simple interface and does all that you require! I'm impressed - set up a folder with a large number of copied text files and then had it replace text within them all and it worked like a charm. Won't work with Office files, for example, but anything with plain text works...

Kruskal

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 72
    • View Profile
    • Donate to Member
Re: Global Text Replacement
« Reply #7 on: May 21, 2007, 01:48 PM »
Vincent - did you look at VGrep? I ask only because I decided to re-download it and take a look. It's got a very simple interface and does all that you require! I'm impressed - set up a folder with a large number of copied text files and then had it replace text within them all and it worked like a charm. Won't work with Office files, for example, but anything with plain text works...
VGrap is certainly closer to the limited utility that I was looking for.  I'll look at.  Who knows -- I might really prefer the fancy features of ReplaceEm or PSPad.

Thanks -- Vincent

PS I wonder why I was so unsuccessful in Googling these utilities for myself.  I could find nothing for free.