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.

Easy question

Old posts that have not been replied to for several years.
Locked
i
iguana
Voice
Posts: 6
Joined: Fri Dec 31, 2004 12:09 pm

Easy question

Post by iguana »

What command syntax would I need to split the following line (after reading it from a webpage) to (for example) $line1 $line2 $line3

Code: Select all

105 c84314d6 M4TECH
The first numeric to $line1
the 8 digit code to $line2
and the name to $line3

I know this is probably going to be simple but so am I!
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

one way;

Code: Select all

scan $line %s%s%s line1 line2 line3
another (more common) way would be this;

Code: Select all

set line1 [lindex [split $line] 0]
set line2 [lindex [split $line] 1]
etc
photon?
i
iguana
Voice
Posts: 6
Joined: Fri Dec 31, 2004 12:09 pm

Post by iguana »

Excellent, exactly what I needed and completed my script! Thanks!
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

<snip>
XplaiN but think of me as stupid
Locked