Robert,

Bruce,

Don F.

Don C.

Tim,

 

Thank you very much for your answers. I have to read it carefully and I hope
that I will understand it, when or before I implement it. Parallel I will
have a look into Alvy’s book.

 

Thanks again!

 

Best Regards

 

Helmuth E. Günther

  _____  

Von: [email protected]
[mailto:[email protected]] Im Auftrag von Robert Pollard
Gesendet: Dienstag, 7. Dezember 2010 01:47
An: [email protected]
Betreff: Re: [Dataperf] separate street and house no

 

Helmuth

How about something like this ? Using the number of subfields as a separate,
hidden field make the formulae for the other two fields much simpler; I've
also included the condition when the initial address field is blank

Initial address: P1F1

# of subfields: P1F2  Format: GZZ::H  (based on a maximum of 8 possible
subfields)

     if  P1F1 = ""
   then  0
else if  subfield[ P1F1 ; " " ; 2 ] < " a"
   then  1
else if  subfield[ P1F1 ; " " ; 3 ] < " a"
   then  2
else if  subfield[ P1F1 ; " " ; 4 ] < " a"
   then  3
else if  subfield[ P1F1 ; " " ; 5 ] < " a"
   then  4
else if  subfield[ P1F1 ; " " ; 6 ] < " a"
   then  5
else if  subfield[ P1F1 ; " " ; 7 ] < " a"
   then  6
else if  subfield[ P1F1 ; " " ; 8 ] < " a"
   then  7
   else  8
  endif
  endif
  endif
  endif
  endif
  endif
  endif
  endif

Street name: P1F3

     if  P1F1 = 0
   then  ""
else if  convert[ "GZZZ9" ; subfield[ P1F1 ; " " ; P1F2 ] = 0
   then  P1F1
   else  substring[ P1F1 ; 1 ; length[ P1F1] - length[ subfield[ P1F1 ; " "
; P1F2 ] - 1 ] ]
  endif
  endif

Street number: P1F4 - Alphanumeric field in case number is, something like
7A or 10-12

     if  P1F1 = ""
   then  ""
else if  convert[ "GZZZ9" ; subfield[ P1F1 ; " " ; P1F2 ] > 0
   then  subfield[ P1F1 ; " " ; P1F2 ] 
   else  ""
  endif
  endif

if the house numbers are strictly numbers and P1F4 is a numeric field, the
formula would be

    if  P1F1 = ""
  then  0
  else  convert[ "GZZZ9" ; subfield[ P1F1 ; " " ; P1F2 ]
  endif

Robert
--
Robert Pollard
www.google.com/profiles/ecology2001
twitter.com/climatechange3
[email protected]
1.212.864.3156





2010/12/6 Helmuth E. Günther <[email protected]>

Hi,

 

My intention: in a report to separate the content of a field into two parts
if the last part of the field is a numeric value.

 

The field street A50;;N;;T contains the street and the house no.

 

Examples:

 

            Main Road 5

            Alexander Guido Place 7

            City 2

            Piazza

            City Yard

 

As the examples show, not each entry contains a house number. So my
intention is to find the number of spaces and check if the last part (n-1)
is a numeric value. If this is true then separate the content of the field
into two parts e.g. field “street” and field “house no”.

 

A appreciate any hint or any help!

 

First: how to find the number of spaces?

Second: how to check if the value of the last part of the content is
numeric?

 

Best Regards

 

Helmuth E. Günther

 


_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf

 

_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf

Reply via email to