3 # Qualifying the name as "_d_output" lest it be mistaken for parser of actual
7 OFS = msg_fs ? msg_fs
: "|"
8 Kfs = key_fs ? key_fs
: ":"
11 /METAR pattern not found in NOAA data
/ {
26 values
[NR] = strip
($
0)
32 print "metar fetch failed" > "/dev/stderr"
34 temp_string = values
[first
["Temperature"]]
35 split(temp_string
, temp_parts
, " +")
36 temp_celsius = temp_parts
[1]
37 temp_fahrenheit =
(temp_celsius
* (9 / 5)) + 32
38 print("temperature_c", temp_celsius
) # °C
39 print("temperature_f", temp_fahrenheit
) # °F
40 for (i=first
["Phenomena"]; i
<=last
["Phenomena"]; i
++) {
41 phenomenon = values
[i
]
43 print("phenomenon" Kfs i
, phenomenon
)