Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have some strings like:
'this is the first string 5862'
'this is the second string 0'
'this is the third string 23'
and i want to separate every string in two parts, one for the text of the string and one for the numeric part to obtain:
'this is the first string' '5862'
'this is the second string' '0'
'this is the third string' '23'
can someone help me ?
thank's
this is the result (text and numberfields) using my previous answer
hope to understand
number is always the last word
blank between words
RESULT:
SCRIPT:
t:
load string, left(string, index(string,number)-1) as text, number;
load *, subfield(string, ' ', -1) as number inline [
string
'this is the first string 5862'
'this is the second string 0'
'this is the third string 23'
];
Hi Michele, It's always text + blank_space + number? In this case you can use:
First part: Left(StringField, Index(StringField, ' ', -1))
Second part: Mid(StringField, Index(StringField, ' ', -1)+1)
or: Subfield(StringField, ' ', -1)
Hi Michele,
if there isn't always a set format in the values, extra spaces etc etc
then you could use purse and keep char functions
KeepChar([myField],'0123456789') AS number
PurgeChar([myField],'0123456789') AS text
hope that helps
Joe
hi ruben, no, the string can be composed by text+blank space+number +text + number and i want to separate the final number from the rest of the string
hi joe,
i can't use keep and purse funcion because my string are composed like
'this is string1 0'
'this is string 2 58'
this is string 3 5869'
and i want to retrive
'this is string1' '0'
'this is string 2' '58'
this is string 3' '5869'
this is the result (text and numberfields) using my previous answer