Forgive me for being a newbie, but here goes...
If I enter the following at a unix prompt;
$ wget "http://nomads.ncdc.noaa.gov/dods/NCEP_NARR_DAILY/200901/ 20090101/narr-a_221_20090101_0000_000.ascii?tmpprs[0][3][94][327]"
and then do this...
$ vi "narr-a_221_20090101_0000_000.ascii?tmpprs[0][3][94][327]"
I get this:
tmpprs, [1][1][1][1]
[0][0][0], 272.8044
time, [1]
733409.0
lev, [1]
925.0
lat, [1]
35.25
lon, [1]
-97.375
Which is great.
To make sure I get the same thing when I compile and run a script, is what I do something along these lines?:
Code:
#include <stdio.h>
int main()
/* URL example */
/*http://nomads.ncdc.noaa.gov/dods/NCEP_NARR_DAILY/200901/20090101/ */
/* narr-a_221_20090101_0000_000.ascii?tmpprs[0][3][94][327]*/
const char text1 = "http://nomads.ncdc.noaa.gov/dods/NCEP_NARR_DAILY/"
const char text2 = "/narr-a_/221_{%d /n, ymd}_0000_000.ascii?"
const char tmpprs;
/* ym = year, month (i.e., 200901) */
/* ymd = year, month, day (i.e., 20090101) */
const int ym = 200901;
const int ymd = 20090101;
const int hour = 0;
int date;
const int pressure_level = 3;
const int longitude = 327;
const int latitude = 94;
{
sscanf( buff, "text1","ym","ymd","text2","tmpprs","hour","pressure_level","latitude","longitude");
}
return ();
I'm sure this isn't exactly right. I’ve never dealt with URLs in C before. I am only wanting to script something so I can see the output. I don't know what to do about a printf statement in this case because there's a URL. The data will be written to a file, eventually.
What am I missing?