3 ms·
Reading my code from some years ago I can see I was very frustrated by a similar problem when parsing .csv files from some financial institutions: # conver
by bluecalm 2y ago
Reading my code from some years ago I can see I was very frustrated by a similar problem when parsing .csv files from some financial institutions:
# converts idiotic number format containing random junk into normal
# represantion of a number
def junkno_to_normal(s):
(...)
There are so many random characters you can insert into dates or numbers. Not only hyphens but also all kind of white spaces or invisible characters. It's always a warm feeling when you import a text document and not only it's encoded in UTF-8 but you see YYYY-MM-DD date format. You know it's going to be safe from there. Unfortunately it's still very rare in my experience (even UTF-8 bit).