Help - Search - Members - Calendar
Full Version: Create Pages and Insert from a list
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
JimS
I have a list of cities that I need to create pages for. I have a template file with "xyz" everywhere in it I need to insert the city name. On a seperate list I have the individual city name that I need to insert into a new page for each. After the insertion of the city name, I need to name the new file " cityname.html ".

I have been trying to come up with a way to automate the insertion of the names to the template file and create the individual pages. I have over 1000 locations to add currently.

I tried figuring out Gawk for Windows to do it, but that did not go well.

Brian Chandler
Why do you need 1000 otherwise identical pages? Can't you just run a script to generate each page as you go?

JimS
QUOTE(Brian Chandler @ Nov 9 2007, 10:06 AM) *

Why do you need 1000 otherwise identical pages? Can't you just run a script to generate each page as you go?


The script is what I am trying to put together. I can put the list of cities in just about any format need to pull from.
Brian Chandler
You appear to want to generate 1000 files, each looking something like:

paris.html contains:

<head>
<title>The city of Paris</title>
...
<body>
<p>Paris is a city <...>


But this seems like a crazy idea. Instead of people accessing paris.html, why not let them access city.html?name=paris and have one file on the server, in php, perl, whatever, that just generates the output on the fly. Then you don't actually even need the list of cities!

But you surely have some reason for needing these 1000 essentially identical files?


JimS
QUOTE(Brian Chandler @ Nov 9 2007, 11:37 AM) *

You appear to want to generate 1000 files, each looking something like:

paris.html contains:

<head>
<title>The city of Paris</title>
...
<body>
<p>Paris is a city <...>


But this seems like a crazy idea. Instead of people accessing paris.html, why not let them access city.html?name=paris and have one file on the server, in php, perl, whatever, that just generates the output on the fly. Then you don't actually even need the list of cities!

But you surely have some reason for needing these 1000 essentially identical files?



Search engine optimization..
Darin McGrew
In what way did your attempt with Gawk for Windows not go well?

I use Perl and htmlpp to generate pages like this.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.