Page 1 of 1

Best way to get a certain token and onwards

Posted: 31 Aug 2012 19:28
by tiago
Please,
how do I get "New Lap Record this Sunday.Must see.flv" out of "Racing.com.New Lap Record this Sunday.Must see.flv"?

Related wish:
- Gettoken should be given a way to return everything that's ahead of it regardless of being other tokens or not.

Re: Best way to get a certain token and onwards

Posted: 31 Aug 2012 21:04
by serendipity
tiago wrote:Please,
how do I get "New Lap Record this Sunday.Must see.flv" out of "Racing.com.New Lap Record this Sunday.Must see.flv"?

Related wish:
- Gettoken should be given a way to return everything that's ahead of it regardless of being other tokens or not.

Code: Select all

text gettoken("Racing.com.New Lap Record this Sunday.Must see.flv", 2, "Racing.com.");

Re: Best way to get a certain token and onwards

Posted: 01 Sep 2012 00:25
by tiago
serendipity wrote:
tiago wrote:Please,
how do I get "New Lap Record this Sunday.Must see.flv" out of "Racing.com.New Lap Record this Sunday.Must see.flv"?

Related wish:
- Gettoken should be given a way to return everything that's ahead of it regardless of being other tokens or not.

Code: Select all

text gettoken("Racing.com.New Lap Record this Sunday.Must see.flv", 2, "Racing.com.");
Thanks but this will be limited to know separators, right?
I may think on a solution for this but thanks for trying, serendipity.

Re: Best way to get a certain token and onwards

Posted: 01 Sep 2012 00:34
by Stefan
tiago wrote:Thanks but this will be limited to know separators, right?
As always. You have to tell the program what you want.
Which is the common pattern to split? Every time the first period/hyphen/space/....? At an specific word? Specific length/pos?






.

Re: Best way to get a certain token and onwards

Posted: 01 Sep 2012 01:24
by PeterH
tiago wrote:Please,
how do I get "New Lap Record this Sunday.Must see.flv" out of "Racing.com.New Lap Record this Sunday.Must see.flv"?

Related wish:
- Gettoken should be given a way to return everything that's ahead of it regardless of being other tokens or not.
Sorry to say: I don't exactly understand the rules for what you want :?

I'd guess you want to see the source string as "."-delimited tokens, and want to get token 3 to 5? Or token 3 up to the end?

Months ago I had a request for this: expand gettoken() (or subtoken() or something like that) to allow specification of the number of tokens to return - analog to substr(). Don wasn't interested...

Re: Best way to get a certain token and onwards

Posted: 01 Sep 2012 08:23
by admin
Wish makes sense. Added.

Re: Best way to get a certain token and onwards

Posted: 04 Sep 2012 16:45
by tiago
Thanks for implementing it, it's saving my skin on several tasks.

By thw way great enhancement the "Highlight Path" feature.