Can we search and replace in multiple files?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
jimbo2112
Posts: 7
Joined: Mon Oct 29, 2007 6:19 pm

Can we search and replace in multiple files?

Post by jimbo2112 »

Hi All,

I need to do S&R in multiple files. ctrl-f5 does not cover replace, only find!

Many thanks

It's just a simple string, reg-ex is not needed.

Thanks!

Jimbo
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

A hot key cannot do S/R without knowing the S/R values. Must do this manually. Could make into a macro if need the same process repeatedly.

Open the files that need the S/R

From the Main Menu, click on Search, click on Replace
In the Replace window:
1. fill in the Find what string
2. Fill in the Replace with string
3. Put a check mark in the box for Scope: All documents
4. Click on Replace All.

Status bar at lower left will show the total number of replacements.
Hope this was helpful.............good luck,
Bob
jimbo2112
Posts: 7
Joined: Mon Oct 29, 2007 6:19 pm

Post by jimbo2112 »

Hi Bob,

What I was looking for was something more like a ctrl f8 key to complement the ctrl f5. There's a search in files, but no search and replace. I would do the replace over multiple files by opening them all, but I literally have thousands of small XML files which need the routine performed on them.

Any other ideas? I would have done this in Perl back along when I have it on my PC and could remember the syntax!

Thanks for the help so far!

Jimbo
acastles
Posts: 6
Joined: Thu Jun 14, 2007 9:05 am
Location: Barcelona
Contact:

Post by acastles »

Do your search first, then right click the results and choose "Open All", and then do your search and replace with Scope set to "All documents".

This has worked well for me for year. Only have had problems if there have been hundreds of files to change as they all need to be open at the same time but if necessary you can select smaller groups of files (say 100 at a time) and do the replace in various passes.

Hope that helps!

Andy
Post Reply