On Wed, 22 Mar 2000 [EMAIL PROTECTED] wrote:

> 
> 
> 
> Quick bit of local advocacy... all London telephone numbers change on
> 22nd April 2000. (0171 xxx xxxx becomes 020 7xxx xxxx and 0181 xxx
> xxxx becomes 020 8xxx xxxx).
> 
> 5 other cities also change their area codes, and all mobile and pager numbers
> change too (see http://www.numberchange.org/ for full details if you may be
> affected).
> 
> Faced with a variety of spreadsheets, databases and text files full of
> possible phone numbers (implied area codes, "220 8537 / 8 / 9", "am
> 0171 ..., pm 0181 ..." etc.), Perl has of course been the tool of
> choice for conversion in this bank, and has come through with flying
> colours.
>

And here. I took the data from the spreadsheet from oftel and made a
bastarding great regular expression.  Generating the regular expressions
to match each areas phone numbers and sprintf formats to generate the new
ones on the fly was something only Perl could do IMO. 
 
 
> RegExps are great, but more than that it's the ability to integrate
> into anything (which many other languages still lack) that made this
> such a pushover.
> 

The ability to manipulate a database directly *and* do regular expressions
makes Perl the only tool for this particular job.

Oh and dynamically generating an SQL query to obtain those rows that
needed to be changed.

All in 126 lines of code ....

/J\ 
-- 
Jonathan Stowe
http://www.gellyfish.com
http://www.tackleway.co.uk

Reply via email to