Skip to content

Instantly share code, notes, and snippets.

@jesuscast
Last active July 29, 2017 02:26
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 jesuscast/071f6fc42607d641337949f612b7a8b4 to your computer and use it in GitHub Desktop.
Save jesuscast/071f6fc42607d641337949f612b7a8b4 to your computer and use it in GitHub Desktop.
import csv
import pprint
import os, sys, re
def RETSLY_Parser(filename):
lines_tmp = []
with open(filename, "r+") as f:
lines_tmp = f.read().split('\n')
lines = []
strings=("id","parcelID","county","landValue","improvementValue","totalValue","full","coordinates","areaSquareFeet","yearBuilt")
for line in lines_tmp:
add_line = False
if any(s in line for s in strings):
add_line = True
if add_line:
lines.append(line)
return "\n".join(lines)
if __name__=="__main__":
filename = sys.argv[1]
full_path = os.path.join(os.getcwd(), filename)
print "Parsing file: %s" % full_path
cleaned_text = RETSLY_Parser(full_path)
print cleaned_text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment