Last active
June 18, 2019 20:05
-
-
Save epcim/b0c4f56bc30fc6dcf9bf0b94e957f4b4 to your computer and use it in GitHub Desktop.
split needle csplit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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