home
/
code
/
khatus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Re-use AWK components
[khatus.git]
/
src
/
awk
/
exe
/
parse_metar_d_output.awk
diff --git
a/bin/khatus_parse_metar_d_output
b/src/awk/exe/parse_metar_d_output.awk
similarity index 78%
rename from
bin/khatus_parse_metar_d_output
rename to
src/awk/exe/parse_metar_d_output.awk
index
1dd2778
..
fa354da
100755
(executable)
--- a/
bin/khatus_parse_metar_d_output
+++ b/
src/awk/exe/parse_metar_d_output.awk
@@
-1,13
+1,6
@@
-#! /usr/bin/awk -f
-#
# Qualifying the name as "_d_output" lest it be mistaken for parser of actual
# metar format.
# Qualifying the name as "_d_output" lest it be mistaken for parser of actual
# metar format.
-BEGIN {
- OFS = msg_fs ? msg_fs : "|"
- Kfs = key_fs ? key_fs : ":"
-}
-
/METAR pattern not found in NOAA data/ {
failures++
exit
/METAR pattern not found in NOAA data/ {
failures++
exit
@@
-15,15
+8,15
@@
BEGIN {
/[A-z][a-z]+ *: / {
split($0, line, ":")
/[A-z][a-z]+ *: / {
split($0, line, ":")
- key = strip(line[1])
- val = strip(line[2])
+ key =
util_
strip(line[1])
+ val =
util_
strip(line[2])
values[NR] = val
first[key] = NR
last[key] = NR
}
/^ +/ {
values[NR] = val
first[key] = NR
last[key] = NR
}
/^ +/ {
- values[NR] = strip($0)
+ values[NR] =
util_
strip($0)
last[key] = NR
}
last[key] = NR
}
@@
-45,9
+38,3
@@
END {
}
}
}
}
}
}
-
-function strip(s) {
- sub("^ *", "", s)
- sub(" *$", "", s)
- return s
-}
This page took
0.029425 seconds
and
4
git commands to generate.