GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Changing a link on hundreds of html pages (https://gfy.com/showthread.php?t=219774)

flashfire 01-12-2004 01:34 AM

Changing a link on hundreds of html pages
 
Okay I have to change all the links on tons of html pages from one url to another...is there a fast way or doing this...any scripts or programs?? thanx

Mishi 01-12-2004 01:37 AM

UltraEdit has a "change in files" option. So do several other proggies...I'm sure someone will be along shortly with a better suggestion...

Brad Xtremepay 01-12-2004 01:37 AM

Try using include files. SSI or php includes. Whatever you have to work with. Split every page up into sections. Use templates!

Amputate Your Head 01-12-2004 01:37 AM

DWMX 04: Find & Replace

flashfire 01-12-2004 01:40 AM

Hey amp with DWMX dont I have to open all the files?? Can you give me some more info?

Thanx Guys:thumbsup

Ben-MensNiche 01-12-2004 01:40 AM

Quote:

Originally posted by Brad Xtremepay
Try using include files. SSI or php includes. Whatever you have to work with. Split every page up into sections. Use templates!
What he said - I use SSI all the time in my own pages, it saves a HEAP of time in administration.

It also means that you can write a template, that has an SSI banner, sidebar, copyright and then you can use PHP to generate your page content - meaning that you only have administer a very small amount of pages instead of 1000s of them.

I remember my first website which I started supporting for a company, it was written in straight html, and had 64,000 pages. Can I say PAIN IN THE ASS?! After I changed to ASP, they had 1 database, 1 template and 5 asp files. Way easier to manage. I would definitely recommend this route!

flashfire 01-12-2004 01:41 AM

Oh, figured it out....THANX EVERYONE!

Amputate Your Head 01-12-2004 01:42 AM

Quote:

Originally posted by flashfire
Hey amp with DWMX dont I have to open all the files?? Can you give me some more info?

Thanx Guys:thumbsup

nope.... just open up one file. Find the string you wanna replace, open up Find & Replace, select Source Code, put in the string to find, and the string to replace it with, and select either, This Doc, Specify a folder, or Entire Site.

done in seconds.

flashfreak 01-12-2004 01:54 AM

if you plan to do it on your computer dreamweaver or homesite can do it.
here's what I'm using if I want to modify links on a server :

find . -type f | xargs perl -pi.bak -e 's/old_string/new_string/g'

it works recursivelly on the folders and makes a backup file too (.bak) which you can skip of course if you don't want it.

Baal 01-12-2004 01:58 AM

Quote:

Originally posted by Amputate Your Head


nope.... just open up one file. Find the string you wanna replace, open up Find & Replace, select Source Code, put in the string to find, and the string to replace it with, and select either, This Doc, Specify a folder, or Entire Site.

done in seconds.

Does DWMX do this on remote files as well? Or just local files? Remote would be slow as shit (assuming it would have to use FTP, as opposed to opening a Telnet or SSH session, which I doubt it can do), but even via FTP, remote search & replace might have it's uses in some cases for me.

MadCap 01-12-2004 01:59 AM

all i got was people trying to sell me shit



dw is good but i was lookin for something to do it on the fly

Adulter 01-12-2004 02:00 AM

Dreamveawer :thumbsup


And try to use SSI next time :glugglug

VeriSexy 01-12-2004 02:00 AM

Search and replace 98 can do it. It's free :thumbsup

leg4 01-12-2004 02:01 AM

bk search and replace on the server

gin 01-12-2004 03:36 AM

do it right.. so you can change it all anytime you want..
make a text file and put the url into it..

PHP Code:

 $filename = ('../url.txt');
 $info = file($filename);
 $url= $info[0];


<?=$url;?> anywhere needed..

might be ghetto but it works :thumbsup

xxxoutsourcing 01-12-2004 03:38 AM

You can use a stream editor like sed that will do it a breeeeze:winkwink:

Baal 01-12-2004 03:58 AM

Quote:

Originally posted by leg4
bk search and replace on the server
Damn, I remember this tool from *years* ago! Do they offer S&R on the various Unix servers?
Gotta love Regular Expressions!

BTW, of course PERL, PHP, Python, shell, even C++ or even C could do it. It's just a matter of what's easiest to do it in.

Toni 01-12-2004 04:18 AM

The best program to do that is TextPipe Pro!

flashfreak 01-12-2004 04:26 AM

Quote:

Originally posted by gin
do it right.. so you can change it all anytime you want..
make a text file and put the url into it..

PHP Code:

 $filename = ('../url.txt');
 $info = file($filename);
 $url= $info[0];


<?=$url;?> anywhere needed..

might be ghetto but it works :thumbsup

the only prob is you have to have php files, so you can't do it for galleries.

lock 01-12-2004 04:27 AM

Textpad do em all in find replace 1 press

Krille 01-12-2004 04:43 AM

i use bk replace em for these kind of things, works like a charm, fast and easy

kenny 01-12-2004 04:47 AM

Here is the way I do it in server shell:


find directory -name '*.html' -exec perl -pi -e 's/http:\/\/www.oldlink.com/http:\/\/www.newlink.com/g' {} \;

uptheyingyang 01-12-2004 04:58 AM

multiupdate



http://www.ksware.com/mu.shtml

Dusen 01-12-2004 05:01 AM

Perl can do it. Search google for "perl find and replace"

DanielS 01-12-2004 05:04 AM

Multi Replace, by Martin Holmes. :)

WebDork 01-12-2004 05:07 AM

If you want to do it on your desktop, there are shitloads of programs out there.

If you want to do it on your server you can do it via PHP or PERL using regex (regular expressions).

Might cost you $10-$20 for someone to code it if you cant do it yourself.

Trax 01-12-2004 06:08 AM

best one is BKMReplace or something
its free

mikeeee 01-12-2004 06:22 AM

format c

why do you have a hundreds of pages? Use SSI or php includes going forward and you only have to change one file.

Zappu 01-12-2004 07:23 AM

With the best editor around: Homesite it's an easy job


All times are GMT -7. The time now is 06:07 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123