1 # Qualifying the name as "_d_output" lest it be mistaken for parser of actual
4 /METAR pattern not found in NOAA data
/ {
11 key = util_strip
(line
[1])
12 val = util_strip
(line
[2])
19 values
[NR] = util_strip
($
0)
25 print "metar fetch failed" > "/dev/stderr"
27 temp_string = values
[first
["Temperature"]]
28 split(temp_string
, temp_parts
, " +")
29 temp_celsius = temp_parts
[1]
30 temp_fahrenheit =
(temp_celsius
* (9 / 5)) + 32
31 print("temperature_c", temp_celsius
) # °C
32 print("temperature_f", temp_fahrenheit
) # °F
33 for (i=first
["Phenomena"]; i
<=last
["Phenomena"]; i
++) {
34 phenomenon = values
[i
]
36 print("phenomenon" Kfs i
, phenomenon
)