feat: non-interactive imports

This commit is contained in:
2025-06-15 21:42:45 +02:00
parent 0b8066923b
commit bcbd2a9077
2 changed files with 84 additions and 12 deletions

16
src/awk/set.awk Normal file
View File

@@ -0,0 +1,16 @@
function escape(str)
{
gsub("\\\\", "\\\\", str)
gsub(";", "\\\\;", str)
gsub(",", "\\\\,", str)
return str
}
BEGIN { FS = "[:;]"; }
/^BEGIN:VEVENT$/ { inside = 1 }
/^END:VEVENT$/ { inside = 0 }
$1 == field && inside { con = 1; duplic = 1; print field ":" escape(value); next }
$1 == field && duplic { con = 1; next }
/^ / && con { next }
/^ / && con { next }
/^[^ ]/ && con { con = 0 }
{ print }