Skip to content

Instantly share code, notes, and snippets.

@6LYTH3
Last active August 29, 2015 14:06
Show Gist options
  • Save 6LYTH3/6d292ae95319152a0e7b to your computer and use it in GitHub Desktop.
Save 6LYTH3/6d292ae95319152a0e7b to your computer and use it in GitHub Desktop.
auto replicate new parametric table
#!/usr/bin/python
import re
pattern = '--'
boxPattern = '/'
container = []
def Main():
with open('out.txt', 'wt') as fout:
with open('replicate_new_parametric_table', 'rt') as fin:
for line in fin:
if not re.search(pattern,line):
fout.write(line)
def Find():
flag = 0
box = ''
with open('out.txt', 'rt') as f:
for line in f:
match = re.search(boxPattern,line)
if match: flag += 1
if flag == 0:
box += line
if flag == 1:
Store(box)
box = ''
flag = 0 # Clear Flag
def Store(box):
container.append(box)
if __name__ == "__main__":
Main()
Find()
print len(container)
print container[10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment