December 6, 2010

Will something like this work?
Assuming your field is P1F2
Create a report variable which will hold the number, if any

IF [convert["GZZZZZ";subfield[P1F2;" ";-1]] >0
THEN convert["GZZZZZ";subfield[P1F2;" ";-1]]
ELSE 0
ENDIF

Then you would have to determine the name conditionally as
P1F2 if rv1 >0
else cat.t.[subfield[P1F2;" ";-4]; " "; subfield[P1F2;" ";-3]; " "; subfield[P1F2;" ";-2]]
the number of terms would depend on the max number of words in the street name. You would have to reformat it to remove opening blanks, or perhaps use a cases statement to eliminate terms for nonexistent words.

Don Codling

On 06/12/2010 5:31 PM, Tim Rude wrote:
Helmuth,
 
Is this for a one-time data conversion or is this something that will need to happen on a regular basis?
 
If it's just a one-time conversion, I would export all of the data to a CSV file and convert it using some other program such as MS Excel. Then import it back into DP.
 
Otherwise you could probably write a DP report to convert the data, using the subfield[] function and virtual subreports to simulate looping through the address words. Do-able, but a real pain. DP's string manipulation routines have never been particularly impressive.
 
Tim Rude
 
----- Original Message -----
Sent: Monday, December 06, 2010 2:47 PM
Subject: [Dataperf] separate street and house no

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

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

Reply via email to