Thanks Dimitri,
I was suggested the following which works great as well:
<cfset thisDirectory = #getDirectoryFromPath(getCurrentTemplatePath())# >
<cfdirectory action="list" directory="#thisDirectory#"
name="directoryQuery" filter="*.html">
<cfoutput>
<cfloop query="directoryQuery">
#directoryQuery.name# --
<cfset fullFileName = thisDirectory & #directoryQuery.name#>
<cffile action="READ" file="#fullFileName#" variable="fileStuff">
<cfset title =
reReplaceNoCase(fileStuff,"(.*<title>)(.*)(</title>.*)","\2")>
#title#<br>
</cfloop>
</cfoutput>
Michel
Dimitri Abramov wrote:
> Is that what you are looking for:
>
> <cffile action="read" file="FileName" variable="fltitle">
> <!--- Read title from a file --->
> <cfset startst=Find("<title>", "#fltitle#")>
> <cfset endst=Find("</title>", "#fltitle#")>
> <cfset start=Evaluate("#startst#+#Len("<title>")#")>
> <cfset end=Evaluate("#endst#-#start#")>
> <cfset descr=Mid("#fltitle#", "#start#", "#end#")>
> <cfset descr=Trim("#descr#")>
> <cfset descr=StripCR("#descr#")>
>
> Dimitri
>
> -----Original Message-----
> From: Michel Rouse [mailto:[EMAIL PROTECTED]]
> Sent: February 19, 2002 3:52 PM
> To: Toronto CFUG
> Subject: [CFTALKTor] getting the page title
>
> This seems like it should be easy enough to do, but I can't think of an
> effecient way to do it.
>
> I have a directory of html files, an I would like to retrieve the titles
> from these pages (ie. what's between the <title></title> tags)
>
> any suggestion would be appreciated.
>
> Thanks in advance,
> Michel
>
> --
> "Put your hand on a hot stove for a minute, and it seems like
> an hour. Sit with a pretty girl for an hour, and it seems like
> a minute. That's relativity."
>
> -- Einstein, Albert
> _______________________
>
> Michel Anthony Rouse
> Webmaster
> Steltor
>
> 2000 Peel street, 4th floor
> Montreal, Quebec
> H3A 2W5
> Canada
>
> tel: +1 (514) 733-8500 x-5001
> fax: +1 (514) 733-8878
> [EMAIL PROTECTED]
> www.steltor.com
>
> Toll free in North America: 1-800-675-2991
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: Michel Rouse <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: Dimitri Abramov <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
--
"Put your hand on a hot stove for a minute, and it seems like
an hour. Sit with a pretty girl for an hour, and it seems like
a minute. That's relativity."
-- Einstein, Albert
_______________________
Michel Anthony Rouse
Webmaster
Steltor
2000 Peel street, 4th floor
Montreal, Quebec
H3A 2W5
Canada
tel: +1 (514) 733-8500 x-5001
fax: +1 (514) 733-8878
[EMAIL PROTECTED]
www.steltor.com
Toll free in North America: 1-800-675-2991
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: Michel Rouse <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)