See
gawk
to extract the section you need. -i inplace
will update the file it's working ongawk -i inplace -f extract.awk journals/*
BEGIN {
true = 1
false = 0
printLine = false
}
{
if ($0 ~ /^- \[\[{HEADER}\]\]:/) {
printLine = true
} else if ($0 ~ /^-[:space:]*/) {
printLine = false
}
if (printLine) print $0
}
find
and delete all zero-byte filesfind journals/* -size 0 -print -delete
assets
folder to include only the assets your new files needgrep "\.\.\/assets\/.*)" journals/* -oh | awk '{print substr($0, 11, length($0)-11)}'
cd assets
setopt EXTENDED_GLOB
rm -- ^(X|Y|Z)
Work/Pepper Content
awk
script made it easy to extract things