Skip to content

Instantly share code, notes, and snippets.

@epcim epcim/needle.sh
Last active Jun 18, 2019

Embed
What would you like to do?
split needle csplit
# example usage: to split yaml with multiple documents
needle() {
SUFFIX=${1##*.}
NEEDLE=${2:----}
csplit -b "%03d.$SUFFIX" -zsf $(basename $1 .$SUFFIX) $1 /$NEEDLE/+1 {*}
}
needle vega-objects.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.