thanks 4 helping dick

really this line does most of what i need
<cfset last = listLast(data, "USGS")>

takes me right to the last entry without messing with the rest
heres the code to get there
<cfhttp url="" "
method="get">
</cfhttp>

<cfset data = ""> <cfset last = listLast(data, "USGS")>

which gives me an output of
09085000 2004-07-23 00:45 790 63.1

now all i need to do is take each piece and insert to db
09085000 = river code
2004-07-23 = date
00:45 = time
790 = river flow
63.1 = water temp

the prob im having is peicing it out
i tried what matthew suggested but threw errors
i thought listGetat would work but it doesnt

i been up 2 damn long lol




---------- Original Message ----------------------------------
From: Dick Applebaum <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date:  Thu, 22 Jul 2004 23:59:26 -0700

>no need to write read a file.
>
>Just use the CFHTTP.FileContent
>
>prolly the reason listlast doesn't work is the new lines are 2 chars CR  
>& LF
>
>1) rereplace all chr(13) with nothing
>2) specify chr(10) as a delimiter in the listlast (last paraneter)
>
>HTH
>
>Dick
>
>"The nice thing about standards is that there are so many of them to  
>choose from."
>- Andrew S. Tanenbaum -
>
>On Jul 22, 2004, at 11:22 PM, dave wrote:
>
>> i have gotten it written to a file and read and here is the output  
>> using listLast
>>  not really giving me the last, maybe cause im writing tot a txt  
>> andnot a csv?
>>
>>  http://www.rockymtanglers.com/flows/try.cfm
>>
>>  code
>>
>>  <!--- retrieve info from USGS website --->
>>  <cfhttp  
>> url=""
>> dd_cd=01&dd_cd=18&format=rdb&period=1&site_no=09085000&01_00060 "
>>  method="get">
>>  </cfhttp>
>>
>>  <!--- place contents into a formated variable --->
>>  <cfset page = #HTMLEditFormat(cfhttp.filecontent)#>
>>
>>  <!--- write variable to text file --->
>>  <cffile action=""> >>  addnewline="no"
>>  file="c:/websites/sites/flows/flowData.txt"
>>  output="#page#">
>>
>>  <!--- read from just written text file --->
>>  <cffile action=""> >>  file="c:/websites/sites/flows/flowData.txt"
>>  variable="data">
>>
>>
>>
>>  <!--- <cfdump var="#data#"> --->
>>
>>  <!--- get last line from test file --->
>>  <cfset line = listLast(data, chr(13))>
>>
>>
>>
>>  <cfoutput>
>>  #Line#
>>  </cfoutput>
>>  
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to