I want to extract the string between the curly bracket eg.From the line {dupe_core/pads/tran_w_1} i need only "dupe_core/pads/tran_w_1" i tried this script with regular expression in perl................... ................... <CMD> windowSelect 444.235666.5542.2656565.1255 <CMD> spaceObject -fixSide bottom -space 0 Spacing instances ... Adding vertical channel spacing of 0.0000um between the following selected instances/modules: {dupe_core/pads/tran_w_1} {dupe_core/pads/tran_w_1} {dupe_core/pads/htran_d_13} {dupe_core/pads/rec_p_14} {dup/pads/VDD_ight1} {dup/pa/GND_g} {dummy_core/pads/dummy_dig22} {dupe_core/pads/dummy_dig23} {dupe_core/pads/comp_pad1} {dupe_core/pad/CORE_vdd1} <CMD> deselectAll <CMD> selectInst dummy_core/pads/IO_gnd_right18 <CMD> selectInst dummy_core/pads/IO_vdd_right18 <CMD> uiSetTool move5 .............. ............... ....................
It works except in 1 place, where in a single line 2 times the match is required. i.e., at this line {dup/pads/VDD_ight1} {dup/pa/GND_g} It is giving only "dup/pads/VDD_ight1" and not giving the second match "dup/pa/GND_g" I want it like,$fn = "/home/t8.g"; open FP, "$fn" or die "Error in write:$!"; while (<FP>){ if($_ =~ m/{/g){ $a = $'; if($a =~ m/}/g){ print "Line no. $..Occurence Identified\n"; open FP1, ">>/home/t9.g" or die "Error in write:$!"; print FP1 "$`\n"; close FP1; } } else{ print "Line no. $..No Occurence\n"; } } close FP;
So can any one help me in finishing this task.... thanks in advancedupe_core/pads/tran_w_1 dupe_core/pads/tran_w_1 dupe_core/pads/htran_d_13 dupe_core/pads/rec_p_14 dup/pads/VDD_ight1 dup/pa/GND_g dummy_core/pads/dummy_dig22 dupe_core/pads/dummy_dig23 dupe_core/pads/comp_pad1 dupe_core/pad/CORE_vdd1
In reply to Perl Log file extraction help required by renjoooz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |