-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvezmiacti.awk
More file actions
34 lines (31 loc) · 908 Bytes
/
vezmiacti.awk
File metadata and controls
34 lines (31 loc) · 908 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
34
BEGIN {
print "BEGIN:VCALENDAR"
print "PRODID:-"
print "VERSION:2.0"
print "METHOD:PUBLISH"
FS=";" # .csv separated by ";"
OFS="" # don't separate output fields
}
/^Předmět/ {
# head - skip
}
! /^Předmět/ {
# non-head
dt_begin = gensub(/([[:digit:]]+).([[:digit:]]+).([[:digit:]]+)/, "\\3\\2\\1", "g", $2) # convert to YYYYMMDD form
dt_end = gensub(/([[:digit:]]+).([[:digit:]]+).([[:digit:]]+)/, "\\3\\2\\1", "g", $4) # convert to YYYYMMDD form
url = $16
print "BEGIN:VEVENT"
print "URL:", url
print "DTSTART;TZID=Europe/Prague;VALUE=DATE:", dt_begin
print "DTEND;TZID=Europe/Prague;VALUE=DATE:", dt_end
print "SUMMARY:",$1
print "DESCRIPTION:", url
print "CLASS:PUBLIC"
print "TRANSP:TRANSPARENT"
#print "SEQUENCE:1"
print "UID:", "vezmi-a-cti-", dt_begin
print "END:VEVENT"
}
END {
print "END:VCALENDAR"
}