[geeks] using script to generate files from a template

Peter L. Wargo pwargo at basenji.com
Sun Jun 16 11:25:28 CDT 2002


On Sunday, June 16, 2002, at 03:03 , William S. wrote:

> Can anyone suggest a script that will enable me to generate
> multiple files based on a template? Each file would have a different
> filename designated in a list and insert specific strings into
> each file. For example:

Simple.  I do this all the time.  Stick some token in the file where you 
are doing the substitution.  For example:

Bill like to eat <<item>>, while reading <<book>>.

Even a simple sed script will work for the substitution.  If you're 
using PHP, just use the built in CSV reader and do a substitute of the 
read value for the token.

-PEte



More information about the geeks mailing list