in reply to Adding contents of a file into another
Here's what I would do:
- Open up the text file and the HTML file for reading.
- Open up a temporary file for writing.
- Read from the HTML file (in reasonable sized blocks),
up to the point you want to insert, and write each read
block to the temporary file.
- Read from the text file (in reasonable sized blocks),
and write each read block to the temporary file.
- Read the rest of the HTML file (in reasonable sized blocks),
and write each read block to the temporary file.
- Close all files.
- Move the temporary file to the HTML file.
- Eat a slice of chocolate cake for a job well done.
Abigail