1. Kat: parse() Question
- Posted by cklester <cklester at yahoo.com> Oct 13, 2004
- 541 views
- Last edited Oct 14, 2004
No, I haven't checked the docs yet... :) If I have a string like this: "23 '17-5' 14 86" can I parse on the spaces and have the single-quoted items come back as one item? So, for instance, this string "One Two 'Three Four' Five 'Six Seven Eight'" would parse to { "One", "Two", "Three Four", "Five", "Six Seven Eight" } I'm sure you've got a function for that... Can you help me out here?! Thanks! :) -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
2. Re: Kat: parse() Question
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 13, 2004
- 545 views
- Last edited Oct 14, 2004
cklester wrote: > > No, I haven't checked the docs yet... :) > > If I have a string like this: > > "23 '17-5' 14 86" > > can I parse on the spaces and have the single-quoted items come back > as one item? > > So, for instance, this string > > "One Two 'Three Four' Five 'Six Seven Eight'" > > would parse to > > { "One", "Two", "Three Four", "Five", "Six Seven Eight" } > > I'm sure you've got a function for that... Can you help me out here?! I've got exactly that function in my arsenal. I'll did it out and email it to you. -- Derek Parnell Melbourne, Australia
3. Re: Kat: parse() Question
- Posted by cklester <cklester at yahoo.com> Oct 14, 2004
- 541 views
Derek Parnell wrote: > > cklester wrote: > > > > So, for instance, this string > > > > "One Two 'Three Four' Five 'Six Seven Eight'" > > > > would parse to > > > > { "One", "Two", "Three Four", "Five", "Six Seven Eight" } > > I've got exactly that function in my arsenal. I'll did it out and email it to > you. Cool!! Thanks Derek... -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
4. Re: Kat: parse() Question
- Posted by "Kat" <gertie at visionsix.com> Oct 14, 2004
- 528 views
On 13 Oct 2004, at 14:47, cklester wrote: > > > posted by: cklester <cklester at yahoo.com> > > No, I haven't checked the docs yet... :) > > If I have a string like this: > > "23 '17-5' 14 86" > > can I parse on the spaces and have the single-quoted items come back > as one item? No. > So, for instance, this string > > "One Two 'Three Four' Five 'Six Seven Eight'" > > would parse to > > { "One", "Two", "Three Four", "Five", "Six Seven Eight" } > > I'm sure you've got a function for that... Can you help me out here?! No. But that looks simple enough that finding the include to handle it would take longer than re-writing it occasionally. For instance, you could replace all the " " in the single-quotes with "_", and then parse would do what you want. In my experience, the way humans handle punctuation is riddled with errors. Parse(), or any function that calls it, can return the separators you specify, and i did that so i could recover from human error. In the return, the separators will be in their own lil sequence, where they were in relation to the real tokens. Kat
5. Re: Kat: parse() Question
- Posted by "Kat" <gertie at visionsix.com> Oct 14, 2004
- 520 views
On 13 Oct 2004, at 17:17, cklester wrote: > > > posted by: cklester <cklester at yahoo.com> > > Derek Parnell wrote: > > > > cklester wrote: > > > > > > So, for instance, this string > > > > > > "One Two 'Three Four' Five 'Six Seven Eight'" > > > > > > would parse to > > > > > > { "One", "Two", "Three Four", "Five", "Six Seven Eight" } > > > > I've got exactly that function in my arsenal. I'll did it out and email it > > to > > you. > > Cool!! Thanks Derek... See, you don't need me, ck. Sure beats making a request that the lib do something you want, doesn't it? This way, i don't ever need to make any improvements to strtok! Kat
6. Re: Kat: parse() Question
- Posted by cklester <cklester at yahoo.com> Oct 14, 2004
- 529 views
Kat wrote: > On 13 Oct 2004, at 14:47, cklester wrote: > > posted by: cklester <cklester at yahoo.com> > > > > So, for instance, this string > > > > "One Two 'Three Four' Five 'Six Seven Eight'" > > > > would parse to > > > > { "One", "Two", "Three Four", "Five", "Six Seven Eight" } > > > > I'm sure you've got a function for that... Can you help me out here?! > > No. But that looks simple enough that finding the include to handle it would > take longer than re-writing it occasionally. For instance, you could replace > all > the " " in the single-quotes with "_"... Actually, that's a good idea! Thanks, Kat. -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/