Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

TCL scripting- Extraction of a segment from a text

Status
Not open for further replies.

optimuz

Junior Member level 1
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top