Page 1 of 1
search and replace across multiple files?
Posted: Fri Oct 18, 2002 8:39 pm
by jeff mathews
is there already some way to do this in text pad?
i'd like search and replace to work "across multiple files" (with recursive file searching).
Re: search and replace across multiple files?
Posted: Sat Oct 19, 2002 11:32 am
by Ed
File->close all
Search->"Find in Files"
Select all (Ctrl-A)
Right-Mouse-Click
Open All
Search->Replace
Select Scope: "All documents" and "Replace All"
Re: search and replace across multiple files?
Posted: Sun Oct 27, 2002 1:13 am
by Dan Eliot
What Ed said:
File->close all
Search->"Find in Files"
Select all (Ctrl-A)
Right-Mouse-Click
Open All
Search->Replace
Select Scope: "All documents" and "Replace All"
An additional comment:
Only the last two steps are necessary if the files are already open in TextPad (ie: you know which files contain the text you want to replace). Also, you will notice an asterisk * next to each file that TextPad did an actual replacement within. After your multi-file replace, make sure to FILE --> SAVE ALL.
Dan
Re: search and replace across multiple files?
Posted: Fri Nov 01, 2002 8:29 pm
by ram
hi,
my friend asked me this question yesteraday and i suggested that he use a perl script; but reading the above i hope a solution using trextpad can also be found..
here is the problem:
he has a file containing twocoloumns, all occurances of the word ib the first coloumn have to be replaced with the word in the second ;
the number of rows in this file is more than two hundred;
this operation has to be performed on more than thousand files..
.
please do suggest a solution thru textpad ,
thank you
ram
Re: search and replace across multiple files?
Posted: Sat Nov 02, 2002 7:57 am
by Ed
What separates the 2 columns? Give a sample of "before" and "afterwards"
If this is what you have to start with
abc def 1234
hi jkl 5678
mnop qrs
and you want to produce this
def def 1234
jkl jkl 5678
qrs qrs
then this search:
^\(\<[[:graph:]]+\>\)\([[:blank:]]+\)\(\<[[:graph:]]+\>\)
and replace with:
\3\2\3
will do it
(i have a feeling that you will need to "view source" in your browser to see this.)
Re: search and replace across multiple files?
Posted: Sat Nov 02, 2002 8:01 am
by Ed
No, it seems you don't have to "view source" but the search does rely on configure->preferences->Editor->non Posix