improvement: consistent use of delimiter
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
## src/awk/dayview.awk
|
||||
## Generate the view of a day from lines of the form
|
||||
## ```
|
||||
## <start_date>|<end_date>|<start_time>|<end_time>|<file_path>|<collection>|<description>
|
||||
## ```.
|
||||
## Take as input (tab-delimited):
|
||||
## 1. s (start time, as HH:MM)
|
||||
## 2. e (end time, as HH:MM)
|
||||
## 3. starttime
|
||||
## 4. endtime
|
||||
## 5. fpath
|
||||
## 6. collection
|
||||
## 7. description
|
||||
## 8. status
|
||||
##
|
||||
## filter out irrelevant lines, and generate the view of a day
|
||||
## (tab-delimited), including empty hours:
|
||||
## 1. start date
|
||||
## 2. start time
|
||||
## 3. end time
|
||||
## 4. file path
|
||||
## 5. collection
|
||||
## 6. description
|
||||
##
|
||||
## @assign today: Date of `today` in the format %D (%m/%d/%y)
|
||||
## @assign daystart: Hour of start of the day
|
||||
@@ -91,14 +105,14 @@ function hrlines(start, stop, h, starth, stoph, tmp, i) {
|
||||
|
||||
# AWK program
|
||||
BEGIN {
|
||||
FS = "|"
|
||||
FS = "\t"
|
||||
OFS = "\t"
|
||||
LIGHT_CYAN = "\033[1;36m"
|
||||
CYAN = "\033[1;36m"
|
||||
ITALIC = "\033[3m"
|
||||
FAINT = "\033[2m"
|
||||
STRIKE = "\033[9m"
|
||||
OFF = "\033[m"
|
||||
OFS = "|"
|
||||
}
|
||||
$1 == "00:00" && $2 == "00:00" { print today, $1, $3, $4, $5, allday($6, $7, $8); next }
|
||||
$1 == "00:00" { print today, $1, $3, $4, $5, endstoday($2, $6, $7, $8); next }
|
||||
|
Reference in New Issue
Block a user