FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > Utilities / Scripts / Software
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 07-21-2002, 11:46 PM   Postid: 71199
Wassercrats
Site Owner
 
Wassercrats's Avatar

Forum Notability:
291 pts: An Honor To Be Around
[Post Feedback]
 
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!
Wassercrats is offline   Reply With Quote
Old 07-22-2002, 08:56 AM   Postid: 71223
ryount
Site Owner
 
ryount's Avatar

Forum Notability:
94 pts: Helpful Contributor
[Post Feedback]
 
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 *.*
ryount is offline   Reply With Quote
Old 07-22-2002, 10:26 AM   Postid: 71225
Jeff
Site Owner
 
Jeff's Avatar

Forum Notability:
872 pts: Dignified Competence!
[Post Feedback]
 
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.
Jeff is offline   Reply With Quote
Old 07-22-2002, 01:25 PM   Postid: 71241
wesleyclark
Registered User

Forum Notability:
0 pts:
[Post Feedback]
 
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
wesleyclark is offline   Reply With Quote
Old 07-22-2002, 03:01 PM   Postid: 71247
Jeff
Site Owner
 
Jeff's Avatar

Forum Notability:
872 pts: Dignified Competence!
[Post Feedback]
 
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.
Jeff is offline   Reply With Quote
Old 07-22-2002, 03:14 PM   Postid: 71248
Wassercrats
Site Owner
 
Wassercrats's Avatar

Forum Notability:
291 pts: An Honor To Be Around
[Post Feedback]
 
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.
Wassercrats is offline   Reply With Quote
Old 07-22-2002, 04:04 PM   Postid: 71250
Mandi
Blond and Caffeinated
 
Mandi's Avatar

Forum Notability:
703 pts: Dignified Competence!
[Post Feedback]
 
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.
Mandi is offline   Reply With Quote
Old 07-22-2002, 04:18 PM   Postid: 71251
wesleyclark
Registered User

Forum Notability:
0 pts:
[Post Feedback]
 
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
wesleyclark is offline   Reply With Quote
Old 07-22-2002, 05:12 PM   Postid: 71255
Wassercrats
Site Owner
 
Wassercrats's Avatar

Forum Notability:
291 pts: An Honor To Be Around
[Post Feedback]
 
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.
Wassercrats is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 08:32 AM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.