Created
May 24, 2019 19:55
-
-
Save zioproto/5a03af13d8098c2e4287638cc5656853 to your computer and use it in GitHub Desktop.
Split a Yaml file in multiple files
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
import sys, os | |
i = 0 | |
print sys.argv[1] | |
f = open(sys.argv[1]) | |
for line in f.readlines(): | |
if line.startswith('---'): | |
i = i+1 | |
filename = "%02d-%s" % (i,sys.argv[1]) | |
w = open(filename,'a') | |
w.write(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment