In the example, first you have to get rid of "-" and "/", for instance:
? chrtran("123-456/789", "-/", "")
(If you want to get rid of
any non-numeric character, it is slightly more complicated. Also, think whether you want to get rid of points (".") or not.)
The result can then easily be converted to numeric, with val().
>I have table with character field (size 15)
>
>for example: 0719996-0001/71
>
>Now I realized that this field must be numeric not character
>I have many users
>
>I will send all users the new software where the table contains
>the same field as numeric
>
>I need:
>
>If the field type is character, replace all them
>with only numbers
>
>so: 0719996-0001/71 will be 0719996000171
>
>This is an import wizard I will create
>
>Notice that in the future I will have uses whose software still contain
>caracter field type and other users not
>
>So I have to check the field type before conversion
>
>Moises
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)