The file contains a set of data I want to compare the "PIN" on each line if a string is present store the entire line into the new variable
PIN i_hbmc_ieee1500_sel_wir
DIRECTION INPUT ;
USE SIGNAL ;
PORT
LAYER K3 ;
RECT 2090.163000;
END
END i_hbmc_ieee1500_sel_wir
PIN i_hbmc_ieee1501_sel_wir
DIRECTION INPUT ;
USE SIGNAL ;
PORT
LAYER K3 ;
RECT 2090.163000;
END
END i_hbmc_ieee1500_sel_wir wir
The output is getting 1, The code I tried is here, and the expecting outcome as
PIN i_hbmc_ieee1500_sel_wir
PIN i_hbmc_ieee1501_sel_wir
set filedata [open "osi_hbmp_top_briscm_1.txt" r]
set file1 [ read $filedata ]
puts [string compare "PIN" $file1]