Options

Web design, renaming of files

hettyhetty Member Posts: 394
Anybody got an easy way to rename 1800 html files. Im thinking software here. Cause if I change the filenames the links in the rest of the html files will also have to change. Given a small project, but its a pain in the ass. They want to organise their website, rename files so someone there can update their website. Last web designer (used framesets, mostly plaintext pages with a few pictures here and there) just left files all over the place with weird names, person updating isnt all that computer savy so it needs to be organised and logical for her to take it over.

Any ideas?

Comments

  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    What web design software are you using? Dreamweaver will update links when you rename or move a file. I believe you can download a 30 day trial from www.adobe.com if you don't have it.

    edit: By links, I don't mean a link in the way they're traditionally thought of, but any reference to it in any file.

    It sounds like you're going to have to rename the files manually because you're going to have to look at them and give them a meaningful name, right? I can't think of a way you can automate it more than what I suggested.
  • Options
    Darthn3ssDarthn3ss Member Posts: 1,096
    wow, have fun with that one!
    Fantastic. The project manager is inspired.

    In Progress: 70-640, 70-685
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    Considering you'd have to probably script the changing of the actual filenames, as well as update the HTML, maybe it's time to take up .NET. . .

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    livenliven Member Posts: 918
    most folks will poo poo this idea,

    but I would script perl to recurse through all the directories and rename the files.

    You have much flexibility with this option.

    Recently I wrote a script that process dtata. It parses all directories in a given folder and reads the content out of the .xml files. You can easy make the path, files, and extension dynamic!!!
    encrypt the encryption, never mind my brain hurts.
  • Options
    SlowhandSlowhand Mod Posts: 5,161 Mod
    liven wrote:
    most folks will poo poo this idea,

    but I would script perl to recurse through all the directories and rename the files.

    You have much flexibility with this option.

    Recently I wrote a script that process dtata. It parses all directories in a given folder and reads the content out of the .xml files. You can easy make the path, files, and extension dynamic!!!

    Yup. The general consensus is, no matter what language you decide to use, you're looking at some scripting if you want to avoid a few weeks' worth of changing code and file-names by hand.

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Remember, there is a lot more involved than just renaming the files. Each html file will have dozens of references to images, other html files, css, js, etc. If you change one file name, you have to also go through and update that reference in every other file that uses it, otherwise you will destroy the site and end up with a bigger problem than you have now.

    Like I said earlier, I'm pretty sure this is going to involve a lot of manual work as well. You have to open up 124sdf8.jpg to see what it is, and then rename it background-tile-left.jpg or whatever. Dreamweaver (and I'm sure others) will update the references for you, but I can't see a way that you will be able to automate this completely.
  • Options
    hettyhetty Member Posts: 394
    I thought id hold off posting an update until I got a start on it.

    Thanks for the reminder dynamic, I havent used dreamweaver since version 3 or 4 and that was a long time ago. I tried it but renaming of the files didnt seem to woek for me. I dont really know any scripting at all and maybe this is something which would make things alot easier I dont know.

    But anyway, I got a start with a few hours here and there over the last few days. Maybe 4 or 5 altogether. Renamed most of the menu system and got that tidyied up. I manually edited the pages in notepad (hardcore!) and use the replace item in the edit menu for someof it which speeded it up a bit. I know there must be a quicker way of doing this but slow and steady will do me the course (paid by the hour!). Client is happy with it also and just wants to get the mess sorted out and the website updated once and for all. I would go with a new website but the client is happy with design and layout so what do i know. Ive about 400 of the files sorted out of the 1800 so far. Its looking at about 2 to 2.5 days of 8 hours a day to sort it out but im spreading it over the next week or so, whenever i get some down time.
  • Options
    dynamikdynamik Banned Posts: 12,312 ■■■■■■■■■□
    Did you make a new site in Dreamweaver and point it at the root of the site? You need to do that so it will index all the files. If you just open them up and edit them randomly, it won't provide that functionality. PM or post if you have any problems. It'll definitely save you a lot of time.

    The only reason I discouraged the scripting suggestion is because you have to inspect each file individually in order to give it a meaningful name. I don't see how you can automate that.

    Notepad is definitely hardcore. You might want to give Notepad++ a shot though since it does syntax highlighting and things like that: http://notepad-plus.sourceforge.net/uk/site.htm That might make things a little easier on you.
  • Options
    hettyhetty Member Posts: 394
    dynamik wrote:
    The only reason I discouraged the scripting suggestion is because you have to inspect each file individually in order to give it a meaningful name. I don't see how you can automate that.
    Yeah, I was thinking maybe listing the files in to a CSV and then just writing the new filename next to it and using that file for the conversion. But then I dont know anything about scripting so I would even know where to start to get that working.
    dynamik wrote:
    Notepad is definitely hardcore. You might want to give Notepad++ a shot though since it does syntax highlighting and things like that: http://notepad-plus.sourceforge.net/uk/site.htm That might make things a little easier on you.
    Nice, just checked it out. Thanks, colour codes everything just what I needed! Looking at all that code makes my eyes go all funny after a while icon_eek.gif
Sign In or Register to comment.