Using Arduino to do the heavy string manipulation is a pain. The best solution I've found is to put all thr files in SPIFFS, like Wawa suggested, and then use JavaScript to build the webpage. All files on the Arduino are static: you can stream them without changing them.
To get variables in your JavaScript, just send another request to the Arduino (either using HTTP if it's a one-time action, or using WebSockets if you want the values to be updated in real-time without refreshing the page). The second request can just send the values in any format you like. If you need just a few values, just send them as plain text with some separator (us snprintf), otherwise, you could use JSON for example.
I see you're trying to add a data file into the HTML: just use JavaScript to fetch that file using a second request.
Pieter