Forum Moderators: open
I tried searching through the site and google for many many Find and replace scripts in both VB and Javascript.
Basically This is what im looking for, and if ANYONE could provide ANY help i would greatly appreciate it. At least point me in the right direction to start.
Im looking to write a general find and replace script, and here is what i want it to do...
I have top100.xls which is a spreadsheet with the top 100 cities in California sorted by population.
I have an html File where I have "Los Angeles" as the header, lets call it variable X.
What im looking to do is have this script is take every city (1-100) in the list, replace variable X with that city name, and save (output/write) it as X.htm
Again, any help appreciated
Look into the FileSystemObject - it enables you to save and load text files. So your script would be something like:
1. Open Excel file using ADO.
2. Load your prepared HTML template, with delimiters (eg *cityname*) where you want to insert the city name, using FileSystemObject.
3. Loop through each Excel row, do a simple replace on the *cityname* in the template text, and then save the result as cityname.htm using FileSystemObject.
HTH