1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to replace HTML div tag in multiple .html files

Discussion in 'HTML & JavaScript' started by Automation247, Jun 14, 2014.

Tags:
  1. Automation247

    Automation247 Regular Member

    Joined:
    Jan 21, 2014
    Messages:
    403
    Likes Received:
    126
    Occupation:
    Making some $$$
    Location:
    SPAMMING 24/7 FROM SOMEWHERE IN EUROPE
    Home Page:
    Hello guys,

    I'm trying to figure out how I can replace a div tag in multiple .html files.

    My website is based in HTML5 and I have +50 .html files. I want to stop replacing these type of html codes manually.. it takes a lot time.

    Example HTML code I want to mass replace:

    Code:
    <div class="contact-details">
                                    <h4><b>ABOUT US</b></h4>
                                    <ul class="contact">
                                    <p>Text here.</p>
                                    <li><p><i class="icon icon-skype"></i> <strong>Skype:</strong> <b>#skypeidhere</b></p></li>
                                    <li><p><i class="icon icon-envelope"></i> <strong>Email:</strong> <a href="contact.html">contact@domain.com</a></p></li>
                                </ul>
                            </div>

    P.S. If someone give me a quick solution, I'm willing to give $10.
     
  2. JasonS

    JasonS Jr. VIP Jr. VIP

    Joined:
    Sep 15, 2012
    Messages:
    2,989
    Likes Received:
    912
    Home Page:
    Its easy man, use notepad++ for mass changing in file texts.

    For $10? donate it to some charity. :)
     
    • Thanks Thanks x 1
  3. Automation247

    Automation247 Regular Member

    Joined:
    Jan 21, 2014
    Messages:
    403
    Likes Received:
    126
    Occupation:
    Making some $$$
    Location:
    SPAMMING 24/7 FROM SOMEWHERE IN EUROPE
    Home Page:
    Hmm... I'm trying to do it, but notepad++ don't allow me the paste the div html text.

    I recorded a quick video: http://screencast.com/t/Coh5s4WLs


    EDIT: PROBLEM SOLVED. I DID IT WITH DREAMWEAVER, IT'S PERFECT TO DO THIS.
     
    Last edited: Jun 15, 2014
  4. Schvamp

    Schvamp Power Member

    Joined:
    Feb 13, 2012
    Messages:
    684
    Likes Received:
    549
    Location:
    Hogwarts
    So is notepad++, you just gotta use the right function ;)
    [​IMG]
     
    • Thanks Thanks x 1
  5. Automation247

    Automation247 Regular Member

    Joined:
    Jan 21, 2014
    Messages:
    403
    Likes Received:
    126
    Occupation:
    Making some $$$
    Location:
    SPAMMING 24/7 FROM SOMEWHERE IN EUROPE
    Home Page:
    I also tried to do it with that function, but it didn't let me to paste all the text.. (I didn't record this in the video)


    Let's forget this, dreamweaver is perfect haha :)

    [​IMG]
     
  6. xha44a

    xha44a Power Member

    Joined:
    Dec 2, 2012
    Messages:
    532
    Likes Received:
    444
    Hey,

    I used to do this. Had a site with 200+ pages. Made a change to the menu bar. Had to edit every page. I eventually ended up going with a tool called "PowerGrep" - if you're at all familiar with linux it's basically grep for windows on steroids. Can have it search and find stuff in folders/across multiple files and replace. Highly recommended.

    XH
     
    • Thanks Thanks x 1
  7. Schvamp

    Schvamp Power Member

    Joined:
    Feb 13, 2012
    Messages:
    684
    Likes Received:
    549
    Location:
    Hogwarts
    Well.. Or you could both use PHP. It's pretty nice ;)
     
    • Thanks Thanks x 1
  8. THUNDERELVI

    THUNDERELVI Elite Member

    Joined:
    Sep 12, 2009
    Messages:
    2,202
    Likes Received:
    1,725
    Gender:
    Male
    Location:
    W3
    Notepad++ for the win! It can handle replacing millions of lines in just seconds.
     
    • Thanks Thanks x 1
  9. srb888

    srb888 Elite Member

    Joined:
    Jul 30, 2008
    Messages:
    3,260
    Likes Received:
    5,067
    Gender:
    Male
    Occupation:
    WebzSurfer
    Location:
    Sun, Mon, Tue, WTF, Sat!!! :)
    Use UltraEdit for multiline find/replace. Also one of the best Notepad replacements...

    [​IMG]
     
    • Thanks Thanks x 1
  10. mothh

    mothh Newbie

    Joined:
    Feb 11, 2014
    Messages:
    23
    Likes Received:
    0
    You can use phpDesigner 8 for that, it is a bit more advanced than Notepad++
     
  11. Tokarev

    Tokarev BANNED BANNED

    Joined:
    May 3, 2014
    Messages:
    106
    Likes Received:
    41
    Perl would be the best solution for me. :)
     
  12. Grily

    Grily Newbie

    Joined:
    May 1, 2013
    Messages:
    22
    Likes Received:
    1
    For future reference, you can use the text editor "Sublime Text" and use the search and replace function (Ctrl+H) - That way you will be able to change keywords in all files.
     
  13. allroy

    allroy Registered Member

    Joined:
    Aug 4, 2013
    Messages:
    67
    Likes Received:
    18
    ToolBucket plugin for Notepad++ will do multiline find and replace as well.