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.
Help for those learning Tcl or writing their own scripts.
whittinghamj
Op
Posts: 103 Joined: Sun May 21, 2006 4:50 pm
Post
by whittinghamj » Fri Sep 21, 2007 6:22 pm
I have an output of
I am trying to strip out (delete) everything before the " / " AND get rid of the " / " as well. Any ideas please? the part of 123 will change from between 4 and 8 letters so cannot do a static removal - need to search for " / " and del everything < it if that makes sence
Thanks in advance
rosc2112
Revered One
Posts: 1454 Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania
Post
by rosc2112 » Fri Sep 21, 2007 6:43 pm
Code: Select all
regsub {(.*?)/(.*?)} $inputvar {\2} outputvar
Check the tcl regsub manpage for details about subSpec and such.
TCL_no_TK
Owner
Posts: 509 Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire
Post
by TCL_no_TK » Fri Sep 21, 2007 6:44 pm
Try using
split [lindex [split "123/4567.89" /] 1]
would return
4567.89