This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

New at this Stripping Thing

Old posts that have not been replied to for several years.
Locked
D
Darkj
Halfop
Posts: 86
Joined: Sun Jul 06, 2003 9:58 pm

New at this Stripping Thing

Post by Darkj »

This is probably a really dumb question, but I'm new at stripping lines for data.

I have editted a script so that it stores items like this

1000=Nick|request and stuff|status|date requested

To break it down
1000 == request id
Nick == users nick
request == request of the user, undertimned size.
status == Status of the request
date requested == obvious

Now i've tried using the [split $whatever "|"], but its doesn't do the job right without a ton of code. Is there an easier way to getting those 5 variables from that line without making 10 lines of code to do it?

Help would definately be appreciated.
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Code: Select all

set text [split "1000=Nick|request and stuff|status|date requested" |]
set request [lindex $text 1]
set status [lindex $text 2]
set date [lindex $text 3]
set reqid [lindex [split [lindex $text 0] =] 0]
set nick [lindex [split [lindex $text 0] =] 1]
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
D
Darkj
Halfop
Posts: 86
Joined: Sun Jul 06, 2003 9:58 pm

Post by Darkj »

Awesome, thanks alot.
Locked