Modifying all files of a site

Discussion in 'Site & Server Administration' started by onlinedude, Jun 22, 2005.

  1. #1
    I've got a site of about 300 pages that I built before I knew much about server side includes, etc.

    Now, I want to change one aspect of every page that's the same on all 300 pages (the top part with the logo, etc). Is there some tool I can use to do this - or do I just need to bit the bullet and edit all 300 pages one by one.

    Thanks in advance for any suggestions.
     
    onlinedude, Jun 22, 2005 IP
  2. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If it's a linux/unix server, and you can get to the shell, you could probably use a string of command line tools to go through and modify each file. This might be a good time to make the pages dynamic though, so you can avoid it in the long run. I can't think of commands off the top of my head to do what you want, but I could probably look it up. I'd think it would be some combination of a for loop, and awk, sed, cut or something like that.. depending on what you want to do. =)

    Or you could do it with a php script, open the files one by one, make the change, close it, move on. Bash or php, doesn't really matter.
     
    nddb, Jun 22, 2005 IP
  3. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #3
    http://www.unix.com/archive/index.php/t-7629.html

    There are some examples here of find and replace in multiple files. I would be very careful though, you don't want to mass mess up all your files at once. =) I'd try it a few times on a test set of data before you do it on all 300 files.
     
    nddb, Jun 22, 2005 IP
  4. Christopher

    Christopher Peon

    Messages:
    482
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Christopher, Jun 22, 2005 IP
  5. jamjv

    jamjv Peon

    Messages:
    113
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    jamjv, Jun 22, 2005 IP
  6. netaddict

    netaddict Peon

    Messages:
    640
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #6
    There is an excellent "find and replace" function inbuilt in Dreamweaver.
     
    netaddict, Jun 22, 2005 IP
  7. onlinedude

    onlinedude Peon

    Messages:
    1,193
    Likes Received:
    322
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks so much to everyone for all of your help!

    I amazed - 5 very helpful answers in less than an hour.

    I settled on using Actual S&R. It seems easy to use and powerful.
     
    onlinedude, Jun 22, 2005 IP
  8. tomecki

    tomecki Peon

    Messages:
    369
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I have a script in perl that will change everything what you want in one moment. PM me and I will send you a script.
     
    tomecki, Jun 23, 2005 IP