|
-
Oct 3rd, 2002, 09:18 PM
#1
Thread Starter
PowerPoster
Split up a string?
I want to tokenise a string using shell delimiters...
|, >, <, >>, <<
I can do that fine, except when the string is like:
command1>command2
(i.e - no spaces between commands and tokens)
Any ideas?
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 3rd, 2002, 09:24 PM
#2
Frenzied Member
Just do what you would do to split the string normally, except when you find a delimeter, split at that point, but make the next token equal the delimeter.
Code:
command1>command2
tokenizes to
command1
>
command2
Z.
-
Oct 3rd, 2002, 09:54 PM
#3
Thread Starter
PowerPoster
You're a thinker. 
Cheers,
RJ
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 3rd, 2002, 09:57 PM
#4
Frenzied Member
It becomes a pain in the arse to need to tokenize a string, but need to preserve sections of the string that contain delimeters =).
Z.
-
Oct 3rd, 2002, 10:07 PM
#5
Thread Starter
PowerPoster
Most of the relevant function is done for me, just gotta modify. My brain is fried this last few weeks. Had too much on, and I've fizzled out...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|