|
|
 |
RE: FN-FORUM: help with regular expressions please!
date posted 5th January 2007 12:09
Yes, I'd normalise the database first, that treats the problem at source and
doesn't try to fix it later down the line.
-----Original Message-----
From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of Ben Moxon
Sent: 05 January 2007 12:18
To: FN-FORUM / [EMAIL REMOVED]
Subject: Re: FN-FORUM: help with regular expressions please!
Duncan Glendinning wrote:
>
> Morning!
>
> Right, I have a field in my database, which contains something of the
> form:
>
> Species:Cinnamonum zeylanicum
> Origin: Sri Lanka
>
> Now what I need to do is use some reg expressions to split the field's
> value into two, and save each to a different field, so I have:
>
> Species:Cinnamonum zeylanicum in one, and
> Origin: Sri Lanka in the other.
>
> Obviously, other than Species: and Origin: everything else changes
> from one field to another.
> Any ideas?
So what you are looking for is something that spots the newline? Or an
expression that breaks up the line at the beginning of 'Origin:' ?
If you're splitting the fields anyways, why not have a Species field
that just contains "Cinnamonum Zyelanicum" and an Origin field
containing only the country of origin? It seems a little redundant to
have the same information repeated in every record.
-ben
--
Freelancers, contractors earn more with Prosperity4
Call 0870 870 4414 or visit www.prosperity4.com
and benefit from Inland Revenue approved expenses today.
To advertise here: http://www.freelancers.net/advertising.html
|
 |
|