Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id BFA46116A13A for ; Tue, 21 Feb 2012 17:40:57 -0400 (AST) Received: from plane.gmane.org ([80.91.229.3]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RzxSA-0004pN-N8 for pgsql-sql@postgresql.org; Tue, 21 Feb 2012 21:40:56 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1RzxRx-0007ys-Dh for pgsql-sql@postgresql.org; Tue, 21 Feb 2012 22:40:41 +0100 Received: from g231145177.adsl.alicedsl.de ([92.231.145.177]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Feb 2012 22:40:41 +0100 Received: from tim by g231145177.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Feb 2012 22:40:41 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: pgsql-sql@postgresql.org To: pgsql-sql@postgresql.org From: Tim Landscheidt Subject: Re: How to split up phone numbers? Date: Tue, 21 Feb 2012 21:40:24 +0000 Organization: Lines: 36 Message-ID: References: <4F425DB9.3060604@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: g231145177.adsl.alicedsl.de Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:POjlibq36CYI2nmPXngoR5GH/Do= X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/66 X-Sequence-Number: 36359 (anonymous) wrote: > is there a way to split up phone numbers? > I know that's a tricky topic and it depends on the national > phone number format. > I'm especially interested in a solution for Germany, Swizerland and Austria. > I've got everything in a phone number column that makes hardly sense like: > +49432156780 > 0049 4321 5678 0 > 04321/5678-0 > and so on... > Those 3 samples are actually the same number in different notations. > Aim would be to get a normalized number split up in 4 seperate columns > nr_nation > nr_city > nr_main > nr_individual > so I end up with > 49 4321 5678 0 for central > 49 4321 5678 42 for Mr. Smith > Is this doable? > It would be a start to at least split off nr_nation and nr_city. I seem to faintly remember that there are some anomalies in the German area codes, i. e. "+49 xy" may be city A, with "+49 xyz" being city B. Obviously, you will also not be able to differentiate between normal and extension numbers if they aren't properly marked up in the input. Tim