>Date: 7/12/99
>String Substitution.
>
>Replace string "A" with string "B" when found in column "ColX" of
>a table or selection. For instance, in Atlas GIS, the command would
>be Replace(ColX,"A","B"), or Substitute(RangeName,"A","B") in Excel.
This capability already exists in MapInfo Professional. There is a
tool which you can load into the Tools menu with 'Tools>Tool Manager...'
It is called 'Search and Replace', and the user interface includes:
select 'Table to Search' from list
select 'Column to Search' from list
type 'Search String'
type 'Replacement String'
check 'Case Sensitivity' if desired
Although not quite as simple, the same functionality can be used
programmatically with these two MapBasic statements:
Select * From table Where Instr(1, column, "string") > 0
Update Selection
Set column = Left$(column,(Instr(1,column,"string")-1)) +
"replacementstring" +
Mid$(column,(Instr(1,column,"string")+Len("string")),Len(column))
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]