# DO NOT RUN THIS CODE UNLESS YOU REALLY NEED TO RECREATE THE DELAWARE ADDRESS CSV FILE # CONVERT THIS CELL FROM "RAW" TO "CODE" CELL TO EXECUTE IT. # Select just the Delaware address from the NAD data and put them into a new CSV file # This builds a csv file consisting of all the Delaware addresses. # /Users/mitchellfawcett/Documents/National Address Database 2024 r15/TXT/NAD.txt is source file. # NAD_r15_Delaware.csv" is output file. # ~ 4 minutes with open("/Users/mitchellfawcett/Documents/National Address Database 2024 r15/TXT/NAD.txt", 'r') as infile, open("/Users/mitchellfawcett/Documents/National Address Database 2024 r15/TXT/NAD_r15_Delaware.csv", 'w') as outfile: reader = csv.reader(infile) writer = csv.writer(outfile) line_count = 0 for row in reader: if line_count == 0: writer.writerow(row) # header line_count += 1 else: if row[33] == "DE": writer.writerow(row) line_count += 1