Last active
August 29, 2015 14:06
-
-
Save shanemhansen/5e94f395fda57218b080 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
from Tkinter import Tk | |
from tkFileDialog import askopenfilename, asksaveasfilename | |
Tk().withdraw() | |
FILE = open(askopenfilename()) | |
OUTPUT = open(asksaveasfilename(), "w") | |
lines = FILE.readlines() | |
states = [4,5,6] # 4000, 5000, 6000 | |
print >> OUTPUT, "Im\ta\theader" | |
for line in lines: | |
fields = line.split("\t") | |
if line[0] == '#': | |
continue | |
includeline = False | |
for state in states: | |
if int(fields[1], 10)/1000 == state: | |
includeline = True | |
break | |
if not includeline: | |
continue | |
print >> OUTPUT, "\t".join(fields[0:4]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment