[Templates] Is this a job for TT?
[prev]
[thread]
[next]
[Date index for 2005/02/18]
There's a task I currently do with perl, but would like to see if TT can do
the job more easily.
Although I've used TT just a little bit, I am very familiar with templating
in general, and have the Badger book, so I'm just looking for a pointer on
how to get started with this, and whether TT can even do it.
Here's the mission.
Start with a text file, which is copied and pasted from an Excel
spreadsheet, so it is tab delimited. In this case each line contains a name
and email and other info, and a couple headings, and lines of hyphens. The
perl script reads the file line by line and creates html pages from it.
The Datafile plugin would seem like a good candidate, but here's the catch:
the text file contains several lists within the single file, each of which
gets made into its own html page. Correct me if I'm wrong, but I believe
Datafile has no mechanism to read several different lists within the same
file, stopping at the end of each list, letting TT do something, then
starting the next list.
Here's a simplified version of the text file.
GROUP 1
Broadcast E-Mail Address: group1@x.xxx
me me@x.xxx
you you@x.xxx
he he@x.xxx
-------------------------------------
GROUP 2
Broadcast E-Mail Address: group2@x.xxx
he he@x.xxx
she she@x.xxx
it it@x.xxx
-------------------------------------
GROUP WHATEVER
Broadcast E-Mail Address: group3@x.xxx
we we@x.xxx
you you@x.xxx
they they@x.xxx
So, each of these lists becomes an html page, with href="mailto:me@x.xxx"
and so forth. The perl script "knows" to end the list and start the new one
based on the hyphens and the formatting of the headings.
Is this a job for TT? If so, what is the trick?
It pretty much needs to be a simple text file like this. People in the
office edit the data now and then in Excel, then turn it over to me to
convert into nice looking html pages.
Thanks,
Ron
--------------------------------------------
My mailbox is spam-free with ChoiceMail, the leader in personal and corporate anti-spam solutions. Download your free copy of ChoiceMail from www.choicemailfree.com
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
[Templates] Is this a job for TT?
Ron Pero 07:33 on 18 Feb 2005
|