1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/env python import sys with open(sys.argv[1]) as f: s = "" while "Begin geometry file" not in s: s = f.readline() s = f.readline() while "End geometry file" not in s: print(s.rstrip("\r\n")), s = f.readline()