sorting addresses

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
martib
Posts: 19
Joined: Wed Aug 23, 2006 2:28 pm

sorting addresses

Post 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
bveldkamp

Post 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|
Post Reply