Skip to content

Instantly share code, notes, and snippets.

@carlosleonam
Last active February 17, 2024 01:49
Show Gist options
  • Save carlosleonam/6dc72aa26b86224871bfbe267ec11560 to your computer and use it in GitHub Desktop.
Save carlosleonam/6dc72aa26b86224871bfbe267ec11560 to your computer and use it in GitHub Desktop.
Merge HTML files into ONE only.

Merge HTML files into ONE only

This method is similar "brute force". Pay attention when using it.

grep -iv "</body>" downloads/html/site/page1.html | grep -iv "</html>" | grep -iv "</HTML>" | grep -iv "</BODY>" > downloads/html/site/all.html
grep -iv "</body>" downloads/html/site/page2.html | grep -iv "</html>" | grep -iv "</HTML>" | grep -iv "</BODY>" >> downloads/html/site/all.html
grep -iv "</body>" downloads/html/site/page3.html | grep -iv "</html>" | grep -iv "</HTML>" | grep -iv "</BODY>" >> downloads/html/site/all.html
#..repeat as long as neccessary..
echo "</body></html>" >> downloads/html/site/all.html

original: https://www.linuxquestions.org/questions/linux-software-2/merge-of-html-files-into-a-single-html-or-pdf-284545/

@Arham51
Copy link

Arham51 commented Apr 5, 2023

Hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment