Hi,
Need help in parsing addresses. Please see below raw data and output.
Raw Data
address |
680, glue Girl, 19th Floor; Montreal, Quebec H4H 1T2 , CA |
64 Middle Rd; Hudson, Quebec L0K, CA |
43 Countryside Gun; Pointe-Claire, Québec D7X, CA |
Ottawa, CA |
10 Queen Avenue West, UP M7B 3N7; Suite 2003; Toronto, Ontario 3N7, CA |
27 Glue Bourbeau; Québec, CA |
Output:
address 1 | address 2 | city | state | postal code | country |
680, glue Girl, 19th Floor | Montreal | Quebec | H4H 1T2 | CA | |
64 Middle Rd | Hudson | Quebec | L0K | CA | |
43 Countryside Gun | Pointe-Claire | Québec | D7X | CA | |
Ottawa | CA | ||||
10 Queen Avenue West, UP M7B 3N7 | Suite 2003 | Toronto | Ontario | 3N7 | CA |
27 Glue Bourbeau | Québec | CA |
I have used and modified this regex for US addresses from @BS_THE_ANALYST - ^(?:(.*?);)?\s*(?:(.*?);)?\s*(.*?),\s*([^\d]+)(\d{5}(-\d{4})?)?,\s*(.*)
Hi @jatienza
Thanks for sharing! Is the output what you expected? Or do you need further help?
Hi @gaoa
I still need further help if anyone can modify this regex ^(?:(.*?);)?\s*(?:(.*?);)?\s*(.*?),\s*([^\d]+)(\d{5}(-\d{4})?)?,\s*(.*) to accommodate the raw data for Canada I have posted above.
I guess this is not giving the required solution.