|
|
|
07-21-2002, 11:46 PM
|
Postid: 71199
|
|
Site Owner
Join Date: Nov 2001
Posts: 7,089
|
Directory-wide editing
I'm about to publish a large amount of public domain material on my website--just about everything from http://www.cia.gov/cia/publications/factbook/index.html except flag and map images and a restricted logo. Are you wondering why I should bother? I am too, but I'll think of a reason. I can't resist free stuff. Anyway, I have to alter the same text in over 100 files. Can someone recommend a script that will let me search and replace from every file in a directory that will work in my cgi-bin? I'd rather not have to deal with regular expressions and perl file stuff.
Oh yeah, I'd like it to have the capability of changing permissions on all of them too, with one command (can it be done with telnet?) Its public domain, EXCEPT for a logo, but the files are all write protected when unzipped!
|
|
|
07-22-2002, 08:56 AM
|
Postid: 71223
|
|
Site Owner
Join Date: Jan 2001
Location: Clearwater, FL, USA
Posts: 825
|
Is this something you need to do on a regular basis or just a one shot deal? If it's just a one shot, you might want to try Editpad Lite on a Windows PC. You can download it at: http://www.editpadpro.com/editpadlite.html
I know I have opened close to 100 files at the same time and you can do a search and replace across all of them at the same time. I am sure other editors do the same thing as well.
Oh yea, to get rid of the write protection in Windows,select all the files, then right click, hit properties and uncheck the read only box, or from a dos prompt do: attrib -r *.*
|
|
|
07-22-2002, 10:26 AM
|
Postid: 71225
|
|
Site Owner
Join Date: Jun 2000
Location: Great Lakes
Posts: 4,221
|
I know you said you didn't want it, but here is the command line syntax which Arthur gave me that I've found invaluable and have used dozens and dozens of times now - I couldn't live without knowing it so I have to pass it on because it's handy to know
find * -name '*.htm' | xargs perl -pi -e "s/old_stuff/new_stuff/sg;"
Where you replace htm with the extension of the files you want to be changed, old_stuff and new_stuff.
|
|
|
07-22-2002, 01:25 PM
|
Postid: 71241
|
|
Registered User
Join Date: May 2002
Location: Starkville, MS
Posts: 30
|
Wassercats,
I have been using HomeSite for years and love it. I was made by Allaire until Macromedia bought it. It has a great replace feature. It will allow you to search and replace text in all open documents or search and replace throughout a whole directory. Just tell it what types of files and what directory; tell it what to find and what to replace it with, and it is done. Below is a screen shot:
You can download a trial here: http://www.macromedia.com/software/homesite/
__________________
-j wesley clark
|
|
|
07-22-2002, 03:01 PM
|
Postid: 71247
|
|
Site Owner
Join Date: Jun 2000
Location: Great Lakes
Posts: 4,221
|
Another free option for Windows is BK ReplaceEm from http://www.orbit.org/replace/#download - very easy to use and has served me well.
|
|
|
07-22-2002, 03:14 PM
|
Postid: 71248
|
|
Site Owner
Join Date: Nov 2001
Posts: 7,089
|
Thanks. The command line syntax sounds like the easiest method for this one job, but I'll be uploading one of those scripts too. I didn't want to learn more scripting at this point, but the solution is right in front of me, so I may use it.
|
|
|
07-22-2002, 04:04 PM
|
Postid: 71250
|
|
Blond and Caffeinated
Join Date: Jan 1999
Location: Southern California, USA
Posts: 3,247
|
Another vote for Homesite . . . their extended search and replace has saved my tushie several times, not just large "replace" functions . . . it's successfully hunted down links I thought were gone, etc. Good link validation feature, too.
|
|
|
07-22-2002, 04:18 PM
|
Postid: 71251
|
|
Registered User
Join Date: May 2002
Location: Starkville, MS
Posts: 30
|
Mandi,
HomeSite is by far my favorite HTML editor. My old job bought me the copy I am using now, but I would definitely pay the $99 for it. Worth every penny.
__________________
-j wesley clark
|
|
|
07-22-2002, 05:12 PM
|
Postid: 71255
|
|
Site Owner
Join Date: Nov 2001
Posts: 7,089
|
Those permission changing methods didn't work for me, but I found out about chmod -R 644 *.html, and tried leaving out the -R, and it worked.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 08:32 AM.
|
| |
|
|
|