FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Find in all html files





Da Rossa
Hi
I'd like to change the styles of all my html pages in my site, but doing it manually is so painful.

I have to find this string:

Code:
  <style type="text/css">
<!--
.style1 {font-family: Georgia, "Times New Roman", Times, serif}
-->
  </style>


and replace with this one:

Code:
<style type="text/css"><!--
.style1 {font-family: Georgia, "Times New Roman", Times, serif}
a:link {color: rgb(153, 51, 0);}
a:visited {color: rgb(153, 51, 0);}
a:active {color: rgb(153, 51, 0);}
a:hover {color: rgb(153, 51, 0);}
-->
</style>


But regular text editors like Textpad and Notepad++ appear not to be able to do this. When I paste the first part in the find field, it even automatically includes the "/n" special characters, but it doesn't perform well the "find in files" function.

Do you know a good program to do this automatically?

thanks!
rockacola
You are not using external stylesheet?

Try this:

- create a style sheet in the same directory of your html files (assuming all your html files are in one directory): style.css

- have all your stylings in style.css

- now add this line between the <head> tags:
Code:

<link rel="stylesheet" type="text/css" href="style.css">

and of course remove your existing CSS in your html pages.

- can you see how all your pages reflect on the changes you do in style.css, and you don't have to modify html file at all?

Let me know if this helped Wink
Da Rossa
No, I'm not using a external stylesheet, and I know nothing about CSS.... Also, I decided, since the inception of my site, to minimize the dependence of paralel files; I prefer to let everything be html and, when necessary, some images.

People say CSS is a handy and good thing, but I gotta learn first...
FunDa
I had a software which could do that for multiple files - just search and replace but across many files - but it was a long time ago.


Search the web for it - I forgot its name so no help there I guess. Confused
Agent ME
Da Rossa wrote:
No, I'm not using a external stylesheet, and I know nothing about CSS.... Also, I decided, since the inception of my site, to minimize the dependence of paralel files; I prefer to let everything be html and, when necessary, some images.

People say CSS is a handy and good thing, but I gotta learn first...

Using external stylesheets is perfect for this situation - if you ever want to change all the pages again, then you only have to edit the .css file. Plus, web browsers only need to download the css data once. Not really an issue for a 5-line file, but if you scale up it's good to use an external file. If you're not sure how, it looks like rockacola's post had what you needed to know.
rockacola
Agent ME wrote:

Using external stylesheets is perfect for this situation - if you ever want to change all the pages again, then you only have to edit the .css file. Plus, web browsers only need to download the css data once... .


Ditto. You are using CSS already, it's only the matter of you using it effeciently or not Wink
froginabox
If you're on a Mac, BBedit is all you need.
If you're on *nix and are using vim, do :rs/oldtext/newtext/%
If you're on Windows.... I really don't know, because I've never done development in a Windows environment!

rockacola has the best suggestion however - do this in CSS to avoid having to repeat the process again and again!
Da Rossa
The problem is that I know sh** about CSS
But I'll research.
Thanks anyway.

Anyone else with suggestions of a text-editor or program that does multi-line find-and-replace routines? Smile
Related topics
Site Nav Suggestions...
how to make a SITE on ftp not a forum
Top 10 web design mistakes!..
[ RESOLVED ] - Preview of files
What folder is your html files and images suppose to be in?
Files and databases (server 1)
A img tag that hold's HTML infromation
Default Path For .JPG Files?
Python beginners help!
Replace old HTML file, seem old copy is still running
How to change extension php to html but the php script still
Oops i cant edit the HTML files
How do i make a compiled html file?
Find the best tool to transfer files from iPad to PC
Reply to topic    Frihost Forum Index -> Computers -> Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.