• Welcome! The TrekBBS is the number one place to chat about Star Trek with like-minded fans.
    If you are not already a member then please register an account and join in the discussion!

Multiple HTML FIles

containing what? text? photos? links??

Use a text editor and copy/paste the raw html.

A few dozen pages would take you longer to automate than to just sit down and do it yourself and be done with it.
 
"Combine" as a larger/longer HTML, a slide show or as a text/word processor document? Are you wanting to link to intermediate points in the page (somewhat like the way this bbs links to the first new post)?

Are you familiar with OpenOffice?
 
"Combine" as a larger/longer HTML, a slide show or as a text/word processor document? Are you wanting to link to intermediate points in the page (somewhat like the way this bbs links to the first new post)?

Are you familiar with OpenOffice?



I have multiple chapters of a book that need to be combine, all text.
 
In that case, use a word processor like Open Office, copy and paste the text (not the source) from each HTML page into Open Office. Then, save the final file as HTML. It'll all be in one file.
 
In that case, use a word processor like Open Office, copy and paste the text (not the source) from each HTML page into Open Office. Then, save the final file as HTML. It'll all be in one file.

I can do that in word. I have 200 files to copy and paste, was just seeing if there was a to automate this
 
depends... what OS?

You could do it with 'cat' in the mac terminal (same thing goes for linux), or you could use 'type' with DOS assuming you've got a windows machine.

Examples,

In mac terminal:
cat *.html > example_document.html

In DOS:
type *.html > example_document.html

(for this example you want them to be in numerical or alphabetical order)

You need to be in the correct directory, and be aware that if you use the exact method I've suggested it will copy every file in the directory of that type into one file.
 
Last edited:
Of course this will leave you with some ugly html code, but all the text will be in one file at least...
 
So..... did it work?

I don't see what the above would achieve in all honesty. Concatenating HTML files is not going to make them magically browseable as one file. I doubt many browsers would even display anything past the first </html> (and therefore the end of the first page).

What the OP probably wanted was something that would take a bunch of HTML files and images etc. and combine them in to a document that would maintain the structure of the hyperlinks, formatting and presentation of each page, but make it easier to send around rather than having to ship a directory or a zip file.

On the Windows platform, modern Microsoft help files are in fact exactly this, i.e. multiple compiled HTML documents as one file, with links between documents, which you can send around. The tool for making these is free, available here.

Chmox is a CHM reader for OS X and there are various readers and authoring tools for CHM files available under Linux, so the format is even somewhat cross-platform compatible.

There are tools available to turn CHMs in to actual EXE files that you can run directly, but this is probably not necessary given all Windows computers have a CHM file built in, and for users of other platforms, it's just a short download away (an EXE wouldn't work on these platforms anyway).
 
find and replace to remove the </html> tags would take about 15 seconds, so it seems like a perfectly viable do-it-yourself solution
 
find and replace to remove the </html> tags would take about 15 seconds, so it seems like a perfectly viable do-it-yourself solution

And the <head> sections, the <body> tags, conflicting javascripts and stylesheet sections, not to mention whether the page's internal layout and styling would even work properly with other pages concatenated (it might, it might not, it depends on a lot of things, like position <div> elements, elements with 100% height, elements positioned or styled with javascript, etc.).

Additionally, this solution wouldn't solve the problem of images or stylesheets or external scripts (they'd still have to be packaged separately), and certainly wouldn't preserve internal semantic structure such as links to other pages.
 
If you are not already a member then please register an account and join in the discussion!

Sign up / Register


Back
Top