Merge Multiple html files into one

Hi all
I have written some code to write my output in html.

As i have multiple servers, need to generate single html file. but my code is generating html file for each server.

I have merged the files using below code.

cat /home/*_FinalData.html > /home/MergedFinalData.html

But how to avoid multiple table headers.
All the files are having same headers.
Please let me know how to do that

Thank you

Well, there is not a single web developer on the planet who has any "real professional" experience with web development over the past 5 to 10 years who would approach this problem as you have.

Web developers do not "combine HTML files" from various servers to create a single web page.

We create a single HTML page (which is only the presentation logic) and use other logic (for example asynchronous javascript or AJAX for short) we query the servers for their data and inject that data into our HTML app and display the data.

In the past 5 years or so, give or take, the data is generally returned from the server as a JSON object, complete with status (like success or failure) for the server-side query.

We don't use AWK or SED to process this data and we don't use CURL or WGET to get the remote data, in general.

We mostly use Javascript for AJAX calls (and other logic). I guess that 99.99% of the world web developers use this approach (or a similar approach with Python, etc).

So, if you are serious about creating a "server dashboard" with dials and indicators and text about server status, you should use Javascript, generally speaking. Maybe Python if you don't like JS.

Furthermore, most people do not use plain-ole Javascript or Python for these kinds of tasks in this era (when dinosaurs do not roam the web); but then again Javascript (Plain Ole Javascript) is evolving quickly and there are very easy Javascript calls like fetch() to get remote JSON data.

Web developers generally use a library like jQuery (but that has fallen out of favor, honestly) or a more popular JS framework, using some JS libs or framework like Vue (my favorite), Angular or React, to build web apps these days.

What you are doing, or attempting to do, is something that was done +/- 15 years ago, when the web was young, not now, when the web is very mature and the toolsets to develop web apps are very rich and robust.

Even universities and vocational schools do not teach 'the old ways" of the web anymore!

You might as well be trying to chop down a tree with a sharp rock like a caveman!

:slight_smile: