| View previous topic :: View next topic |
| Author |
Message |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Fri Sep 21, 2007 6:22 pm Post subject: strip chars |
|
|
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 |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Fri Sep 21, 2007 6:43 pm Post subject: |
|
|
| Code: | | regsub {(.*?)/(.*?)} $inputvar {\2} outputvar |
Check the tcl regsub manpage for details about subSpec and such. |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Fri Sep 21, 2007 6:44 pm Post subject: Re: strip chars |
|
|
Try using split | Quote: | | [lindex [split "123/4567.89" /] 1] | would return 4567.89  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Fri Sep 21, 2007 7:14 pm Post subject: [ SOLVED} strip chars |
|
|
| ty very much |
|
| Back to top |
|
 |
|