Page 1 of 1

sorting addresses

Posted: Fri Sep 15, 2006 10:40 pm
by martib
hi,

i want to sort addresses and split them. a line looks like:

Acmelake Road 104 80741 Funkytown

Now I want to split before and after the Zip Code which is always 5 digits.
So the result should be:

Acmelake Road 104|80741|Funkytown

Thanks,
Marti

How to do it with Zip Codes like
Acmelake Road 104 193 00 Funkytown
to become
Acmelake Road 104|193 00|Funkytown

Posted: Mon Sep 18, 2006 7:06 am
by bveldkamp
If it's either 5 digits or 3+2 this will do the job:

Code: Select all

Search:   ([0-9]{3}) ?([0-9]{2})[^0-9]
Replace : |\1\2|
This will also get rid of the space, if you don't want that:

Code: Select all

Search:   ([0-9]{3} ?[0-9]{2})[^0-9]
Replace : |\1|