This commit is contained in:
2025-06-06 10:54:38 +02:00
parent 1fd35de475
commit b5682bf435
2 changed files with 21 additions and 13 deletions

View File

@@ -1,12 +1,12 @@
# print content of field `field`
BEGIN { FS = ":"; regex = "^" field; }
/^BEGIN:VEVENT$/ { inside = 1 }
/^END:VEVENT/ && inside { exit }
$0 ~ field { content = $0; next; }
/^END:VEVENT$/ { exit }
$0 ~ regex { content = $0; next; }
/^ / && content { content = content substr($0, 2); next; }
/^[^ ]/ && content { exit }
END {
if (!type) { exit }
if (!inside) { exit }
# Process content line
content = substr(content, index(content, ":") + 1);
gsub("\\\\n", "\n", content);