TCL scripting- Extraction of a segment from a text

Status
Not open for further replies.

optimuz

Junior Member level 1
Joined
Nov 7, 2011
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Bangalore, India
Activity points
1,392
Hi, I am a begginer in tcl. I am trying with strings and arrays now.

Can anyone tell me how can I extract a particular section of a line using tcl.

For example let my line be
@N: CG364 :"D:\Designs\Source\srl1.v":1:7:1:10|Synthesizing module srl1

I need to copy from ' | ' to the end. How it is possible to do , without converting this to a single string.

Thanks
 

set a "@N: CG364 :"D:\Designs\Source\srl1.v":1:7:1:10|Synthesizi ng module srl1"
regsub {.*\|} $a "" $b

the value of $b is what you want to get.
 
String range <variable> <low index> < high index>.

On Linux tclhelp is helpful.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…