Way to populate variable placeholder names into HTML template from Excel file?

I am a front-end designer / developer for my company. I’ve been asked to look into ways to take an HTML banner ad template and generate hundreds or even thousands of versions with local business names. We would likely receive an Excel file with the hundreds of company names.

So the HTML ad template would consist of a headline saying something like:

BUY WIDGETS FROM [COMPANY NAME GOES HERE]

Then an Excel file with:

ABC Company
DEF Company
GHI Company
(hundreds more…)

It seems like my boss is assuming that we would generate the localized versions in-house, and maybe that would be the best way, but I figure there are 3 main ways it could be done:

  • Find an ad hosting vendor who will take the ad templates and spreasheet (probably in .CSV form?) and generate and place the localized versions themselves
  • Find an out-of-box software or cloud-based solution to do this
  • Build software to do the local version generation in-house

I’ve found a couple open-source software solutions that might be promising, one client-side Javascript based and one server-side PHP based, but other than that not a lot of solutions have jumped out at me, though it seems like a service that would have a pretty good market niche.

Any thoughts or ideas for me on this? I’m in the research stage right now, so any angle is welcome. Also, keep in mind my knowledge is more front-end than with back-ends or databases. Thanks!

What programming tools are you comfortable with? It seems like this could be done with a ~10 line Perl program.

As a front-end dev, really just Javascript and a little PHP.

Well, PHP is somewhat similar to Perl. For the record, I would set up a process where the Excel file is exported to CSV, then a Perl (or any general purpose language with good string handling) reads each company name from the file, and for each name, reads the HTML template and substitutes the company name for a fixed pattern like “[COMPANY-NAME]” and writes it out to a new HTML file, perhaps with the company name embedded in the filename. Seems like that’s all you need.

Yes, very easy to create a small Windows program to do it, reading the Excel file directly and writing out all the html files using the template.