-
-
Save MCMXCIII/580d9c8b809f40eecb44a009efb37fbd to your computer and use it in GitHub Desktop.
Code block Regex
This file contains 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
py import csv | |
import re | |
address_filter=[] #an empty list to store the second column | |
with open('122023jan.csv', 'r', encoding="utf8") as rf: | |
reader = csv.reader(rf, delimiter=',') | |
for row in reader: | |
str(address_filter.append(row[9])) | |
#print(noise_amp) | |
regexp = "(\w+), ([A-Z]{2} [0-9]{5})" | |
regexp = "(\w+) (\w+), ([A-Z]{2} [0-9]{5})" | |
address = re.findall(regexp, noise_amp) | |
print(address) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment