Skip to content

Instantly share code, notes, and snippets.

@zioproto
Created May 24, 2019 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zioproto/5a03af13d8098c2e4287638cc5656853 to your computer and use it in GitHub Desktop.
Save zioproto/5a03af13d8098c2e4287638cc5656853 to your computer and use it in GitHub Desktop.
Split a Yaml file in multiple files
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