You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also tried the first answer to this question (yq 'del(.. | select(. == ~))' Hello.md), but the command ends up eating up the bottom --- at all times which removes denotation of YAML e.g.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I need to remove all properties of YAML in markdown files that have empty values recursively in a directory.
Note: copied from Stack Overflow, as I could not a solution for weeks on there.
Before:
After:
It should remove the entire line no matter what object type it is: array, map, etc.
I currently tried, based another question to run the following:
yq -i 'del(.. | select(tag == "!!seq" and length == 0))' Hello.md
and also replacing!!seq
with!!map
However, the command did not anything.
I also tried the first answer to this question (
yq 'del(.. | select(. == ~))' Hello.md
), but the command ends up eating up the bottom---
at all times which removes denotation of YAML e.g.Beta Was this translation helpful? Give feedback.
All reactions