-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathts_noise.awk
More file actions
executable file
·33 lines (25 loc) · 844 Bytes
/
ts_noise.awk
File metadata and controls
executable file
·33 lines (25 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
NF == 15 {
n = split(FILENAME, path_array, /\//)
call_grid = path_array[n-3]
receiver = path_array[n-2]
band = path_array[n-1]
time_freq = path_array[n]
split(call_grid, call_grid_array, "_")
site = call_grid_array[1]
gsub(/=/, "/", site)
rx_loc = call_grid_array[2]
split(time_freq, time_freq_array, "_")
date = time_freq_array[1]
time = time_freq_array[2]
gsub(/_noise\.txt$/, "", time)
split(date, d, "")
date_str = "20"d[1]d[2]"-"d[3]d[4]"-"d[5]d[6]
split(time, t, "")
time_str = t[1]t[2]":"t[3]t[4]":00"
timestamp = date_str " " time_str
rms_level = $13
c2_level = $14
ov = $15
# Output in correct column order for INSERT
printf "%s,%s,%s,%s,%s,%s,%s,%s\n", timestamp, site, receiver, rx_loc, band, rms_level, c2_level, ov
}