heres what i am doing (so far)
look at this website (watch the wrap)
http://waterdata.usgs.gov/co/nwis/uv?dd_cd=01&dd_cd=18&format=rdb&period=1&site_no=09085000&01_00060
ok, that gives me a csv file that i need but i only need the very last line, so i do the code below which basically gets me the last line and deletes the rest, very simple
<!--- retrieve info from USGS website --->
<cfhttp url="" "
method="get">
</cfhttp>
<!--- place contents into a formated variable --->
<cfset data = "">
<!--- <cfdump var="#data#"> --->
<cfset last = listLast(data, "USGS")>
<cfset riverNumber = listGetAt(last, 1, chr(9))>
<cfset dateTime = listGetAt(last, 2, chr(9))>
<cfset waterFlow = listGetAt(last, 3, chr(9))>
<cfset waterTemp = listGetAt(last, 4, chr(9))>
<cfset setDate = DateFormat(dateTime, "mmm-dd-yyyy")>
<cfset setTime = TimeFormat(dateTime, 'hh:mm:ss')>
ok, so what that has done is like i said before, just gets me the last line, takes the data makes it into a list then breaks the list down into individual variables which are then set and ready to be entered into the database... piece of cake...(thanks to Matthew for helping me with the code)
of course change you spec to get what u want
the we need to work on some code to delete that line in the csv file and loop it until until its done
oh, actually u would probably have to write the csv file to a folder first
which might be like this
<!--- retrieve info from USGS website --->
<cfhttp url="" "
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/123/flows/flowData3.txt"
output="#page#">
<!--- read from just written text file --->
<cffile action=""
file="c:/websites/123/flows/flowData3.txt"
variable="data">
does that help?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

