Hi Sharon - 
Try this:
Create a new column in your table for the UID and enter the following string in the 
value box of the Table-->Update column dialog box:

mid$(xxx,instr(1,xxx,"(")+1,instr(1,xxx,")")-instr(1,xxx,"(")-1)

If you UID column is numeric, use this instead:

val(mid$(xxx,instr(1,xxx,"(")+1,instr(1,xxx,")")-instr(1,xxx,"(")-1))

Where xxx is the column name that holds the raw census data you describe. The Mid$ 
entry returns a substring of the census column starting at the position after the 
first occurrence of the open parenthesis,  the substring being of length determined by 
the position of the first occurrence of the closing parenthesis. 

This would only work consistently if a) brackets exist in the census string; and b) 
the UID you are after is always between only one set of brackets in the census string.

Hope this helps.


Lindsay Giles                     
Senior GIS Analyst

AXYS Environmental Consulting Ltd     
Suite 600-555 4th Ave. SW
Calgary, AB
T2P 3E7
                                  
e-mail:         [EMAIL PROTECTED]
Main Office:    403-269-5150
Direct Line:    403-750-7671 
Fax:            403-269-5245 
Visit our web site at http://www.axys.net

            

-----Original Message-----
From:   Sharon Barnes [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, June 16, 1999 2:52 PM
To:     MapInfo List
Subject:        MI: Editing tables



Hi Folks! I have a challenge. I have worked out a solution but it takes
about 10 steps!!! I'd like to know if there is a more straight forward
query that can produce the same result.

The data is over 900 records of canadian census data at the subdivision
level. The profile data comes with a column for "geography" however, in
order to map the data you need the UID (unique identifier) for each
subdivision in a separate column so that it can be joined with the
boundary file. The following is a sample of the "geography" records that
come with the census data:

Hilton (3557004) TP 00000
Hilton Beach (3557006) VL 00000
St. Joseph (3557008) TP 00000
Laird (3557011) TP 00000
Bruce Mines (3557021) T 00000
Manitoulin, Unorganized, Centre Part (3551092) UNO 00000

Is there a way to query the table and extract only the numeric value
found between the brackets in the middle of each record and place it in
a separate column? The data type is "character" and the column width is
62 but there is zero consistency among the record lengths.

Thanks in advance for your help.

Sharon

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to