Apologies if this question isn't worded very clearly. I'm working on a text-analysis visualisation and I have multiple HTML pages loading the same Processing sketch with p5.js. The only difference between the pages is that I need the sketch to load a different .txt file in setup() or preload() depending on what HTML page it is. The rest of the sketch remains identical.
How can I make my sketch load a different file (01.txt, 02.txt etc) depending on what page it's in? (book_one.html, book_two.html etc). Any help would be great, thank you!