mIRC Homepage
Posted By: fractal exctract text from line - 05/01/21 06:31 PM
hi there
havent been able to find out how to extract text from a long line
the line waries in length and characters but have 2 static points , the "/" that divides them.
the line would look something like this: "some.long.random.word/[31x:]/another.random.word"
i would like to get: "another.random.word" = var1 and "another.random.word" = var2
dont want to remove any special characters in the "words"
no problem if its done in 2 stadges
thnx
Posted By: maroon Re: exctract text from line - 06/01/21 12:47 AM

//tokenize $asc(/) some.long.random.word/[31x:]/another.random.word | echo -a $1 vs $2 vs $3 vs $1-

You can use a literal 47 instead of $asc(/)

If the string is already in a %variable you can use $gettok(%variable,1,47) to fetch the 1st token
Posted By: fractal Re: exctract text from line - 06/01/21 11:32 AM
worked like a charm with $gettok(%var1,1,47) and $gettok(var2,3,47)
thnx
© mIRC Discussion Forums