Last active
August 29, 2015 14:07
-
-
Save farfanoide/7703f8e890bf9c9c3c6f to your computer and use it in GitHub Desktop.
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
import re | |
data_ = re.compile('data_\w+') | |
day = re.compile('\d+') | |
month = re.compile('\w+') | |
data = open('feriados_crudo').readlines() | |
def string_to_date(string): | |
d = day.findall(string) | |
m = month.findall(day.sub('', string)) | |
return m, d | |
def parse(string): | |
print string_to_date(data_.findall(string)[0]) | |
for line in data: | |
parse(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment