Parsing Data with no good ParseINT

Here’s the deal, I want to have my Arduino read this website: http://www.swl-wc.usace.army.mil/pages/data/tabular/htm/tabrock.htm and parse the latest data.

I have labeled the data and condensed it a bit for this post. The data streams across like this if you don’t have a look at the webpage:
DATE TIME POOL TAIL RELEASE GENERATION

13JAN2016 0900 924.73 713.21 13121 208
13JAN2016 1000 924.72 713.09 13134 208
13JAN2016 1100 924.69 713.16 13159 208
13JAN2016 1200 924.66 713.05 13128 208
13JAN2016 1300 924.60 713.07 13118 208
13JAN2016 1400 ---- ---- ---- ----


How in the heck would you parse through the list there to get the “latest” POOL data.

In this case the “latest” data is ---- for the POOL data in which case I would ignore. Would you have to set the “DATE” and “TIME” do a ParseINT (with float?) for “DATE and TIME (set at the nearest hour?)” then how exactly would your read the pool data, it will always be between 881 and 932, but will always be reported with decimals?

I don’t know why this is stumping my processes right now.

There is another site that is “Table Rock Lake Water Level” that you could use the data from however, it’s generated on the fly by an ASP page. That IP for the .info domain covers a lot of lakes.

Thanks for your help,
Captn_JB

When I look at the web site you "link"ed, the third column is NOT pool.

Not that it really matters. In the data that you get, each "row" is delimited by a carriage return and/or line feed. Collect all the data in a string (a NULL terminated array of chars, not that stupid thing that starts with an S), until the carriage return or line feed arrives. Use strtok() to parse the array, based on a space as the token separator. The third token is the one that is interesting (apparently).

Captn_JB: I have labeled the data and condensed it a bit for this post. The data streams across like this if you don't have a look at the webpage: DATE TIME POOL TAIL RELEASE GENERATION

I cannot see that on the page. What I see on that page is a table for:

              Time    Elevation    Tailwater     Release      Generation
  Date        CS/CDT  (ft-msl)     (ft-msl)       (cfs)         (mwh)
__________________________________________________________________________

So what you name "POOL" is labeled "Elevation" in the actual table?

Captn_JB: How in the heck would you parse through the list there to get the "latest" POOL data.

As far as I see in the source code of that page, the actual table data are from line 23 to line 58.

So I'd do it like that: - send a GET request to the file URL address - read the response line by line - skip the HTTP header lines - skip the first 22 lines of the file contents - parse line 23 to 58 for the data you want

Function "strtok()" may be helpful in tokenizing the data fields within the line.

I was not familiar with strtok. I'm sitting on a plane going to Chicago and will research that when I get home.

Your right it was Elevation. I've always known it as Pool Level and it just looked bad when I pasted it so I shortened it to Pool for brevity. I'll be more careful in my posts.

It may make it super easy if line 58 is always the most recent data. I will have to watch it for a few hours and see how much data is displayed, AM/PM checks. However I believe it may just be a rolling set of data and the last line is key.

Great ideas. Thank you.

Captn

The below might be of interest.

http://playground.arduino.cc/Code/TextFinder

There is a parse example in Serial Input Basics which illustrates the use of strtok(). As written the dlimiter is a COMMA but you could easily change it to a SPACE

...R