If you can be assured that there is only one date/time item in this
data, you can loop over each line (using line feeds/carriage returns as
the delimiter), strip off the <TD> tags and use the IsDate() function to
test what is left over.

You could also use a Regular Expression to find a snippet of code that
"looks" like a date/time value.  I bet you could find some pre-built
regexs that look for date/time strings.

M!ke

-----Original Message-----
From: clifton maloney [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 05, 2004 10:42 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] CFHTTP

Hi,

I'm have a senario where i'd like to extract data via CFHTTP and then
extract a date stamp from a table. so far i'm able to remove all the
surrounding html tags and just left with the table tags.

What i'd like to do is extract the date field from this table and store
all the data in the td's and store them as a varible to input in a
database.

Can anyone assist!


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cold fusion Code:
+++++++++++++++++++++++++++++++++++++++++++++++
<cfhttp
url="http://afi.com/membership/scripts/getMemStatus.aspx?CID=BAF199ROG"; 
resolveurl="yes"/><!---  <cfset content = #cfhttp.FileContent#>
<cfoutput> #content# </cfoutput> ---> <cfset
var.input="#cfhttp.FileContent#">

<cfset var.begin="<table">
<cfset var.end="</table>">
<!--- ---- now its just subtracting the all the content you dont
need---- ---> <CFSET find_begin =
#Findnocase("#var.begin#","#var.input#","1")#>
<CFSET find_end = #Findnocase("#var.end#","#var.input#","1")#>
<CFSET string =
#mid("#var.input#","#find_begin#","#evaluate((find_end)-(find_begin))#")
#>
<!--- ----then--- --->
<cfscript>
writeOutput(#string#);
</cfscript>
<cfset var.input="#string#">
<cfset var.begin="String">
<cfset var.end="</td>">
<cfset findTd= #Findnocase("#var.begin#","#var.input#","1")#>
<CFSET find_end = #Findnocase("#var.end#","#var.input#","1")#>
<CFSET string =
#mid("#var.input#","#find_begin#","#evaluate((find_end)-(find_begin))#")
#>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
html returned
++++++++++++++++++++++++++++++++++++++++++++++++++++
<table cellspacing="1" cellpadding="2" rules="all" bordercolor="Black"
border="1" id="dgMemStatus"> <tr bgcolor="SlateGray">
  <td><font color="Ivory"><b>STATUS</b></font></td>
  <td><font color="Ivory"><b>ID</b></font></td>
  <td><font color="Ivory"><b>FNAME</b></font></td>
  <td><font color="Ivory"><b>LNAME</b></font></td>
  <td><font color="Ivory"><b>EMAIL</b></font></td>
  <td><font color="Ivory"><b>DT_END</b></font></td>
  <td><font color="Ivory"><b>COUPON_CODE</b></font></td>
  <td><font color="Ivory"><b>LEVEL</b></font></td>
</tr>
<tr valign="Top">
  <td><font color="Red"><b>ACTIVE</b></font></td>
  <td>42715</td>
  <td>Mark</td>
  <td>Sullivan</td>
  <td>[EMAIL PROTECTED]</td>
  <td>5/1/2005 12:00:00 AM</td>
  <td>BAF199ROG</td>
  <td>Friend</td>
</tr>
</table>
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool,
Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to