Changing specific lines of code from all my HTML pages

292 views Asked by At

Let's assume that

  1. I have thousands of HTML files.
  2. All of them use's the same CSS layout.
  3. All of them are made with exactly 100 lines of code.

Now, I would like to replace lines 40-50 from all of these files with a common set of 10 lines. Is this possible ?

1

There are 1 answers

0
Nojan A. On BEST ANSWER

It's not a html related topic. You should use a programming language.

  • Creat a program.
  • Loop through each of your html files.
  • Replace the desired lines of code (or any other string) with your new content.

By the way if your purpose is just to manipulate a bunch of classes/IDs and content, it's doable with javascript/jQuery. but unlike first solution it will run each time one of your html files are loaded in a browser. i don't recommend this.