Dec 14, 2007, 2:50 PM
Post #1 of 21
This is the contents of my input file. I want to browse through this file and look for "im_im_rdy_samp". If this keyword is found, i want to then pick the string on the next line (in this case FRST_IM_FILE_IO_AMP) and store it in a variable.
Issue with search and capture string from a file
dogy #1050 fi_dy_watch ("im_im_rdy_samp",
if($_ =~ /dogy/)
@temp = split(/\(\"/, $_);
@temp = split(/\"/, $_);
$sync_cap = $temp;
if($_ =~ $sync_cap)
@temp = split(/`/, $_);
With the raw code posted above, i am able to search for the string (im_im_rdy_samp) and the code displays the first line (fi_dy_watch).
I am not able to go to the next line and pick the string starting with this "`" character.
I am pretty new to Perl. Can some-body please help me with this?