Re: Extracting a pattern of numbers from a text string
- From: Helpful Harry <helpful_harry@xxxxxxxxxxxxxxxx>
- Date: Sat, 28 Jan 2006 13:02:00 +1300
In article <s2clt1ttbo1ko17rf8415303f0gr3gfgoc@xxxxxxx>, Wes
<wchester@xxxxxxxxxxxxxxxx> wrote:
> I have a job database with job numbers entered into a text string
> field. My goal is to extract just the numbers out of this text string
> and put this into another field with the set step. I know the format
> of the numbers to extract, but the actual job numbers will be
> different. A job number looks like this: ##.####
If job numbers ALWAYS look like that (ie. two digits, dot, four digits)
then you can simply use the Left and Right functions to extract the
appropriate number of digits,
eg.
NumBeforeDot = Left(TextField, 2)
NumAfterDot = Right(TextField, 4)
These can be calculations in a Set Field script command or Calculation
fields (text or number result) or auto-enter Calculations for a Text /
Number field.
If the numbers can vary in length, but still ALWAYS have a dot in
between, then you'll have to use the Position function to find out
where the dot is and use that as a delimiter,
eg.
NumBeforeDot = Left(TextField, Position(TextField, ".", 1, 1) - 1)
NumAfterDot = Right(TextField, Length(TextField) -
Position(TextField, ".", 1, 1))
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
.
- Follow-Ups:
- References:
- Prev by Date: Extracting a pattern of numbers from a text string
- Next by Date: Re: Extracting a pattern of numbers from a text string
- Previous by thread: Extracting a pattern of numbers from a text string
- Next by thread: Re: Extracting a pattern of numbers from a text string
- Index(es):
Relevant Pages
|
Loading