i got a huge doc file in which i have to extract something..the scenario is
Module: 1 ID:001 Customer : yes Module: 2 ID:002 Customer : no Module: 3 ID:003 Customer : yes Module: 4 ID:004 Customer : no
I have to extract the ID no and Module no whose Customer tag is "Yes"
I have used an array to extract ID if its yes but its not taking the module name
my $i; for ($i = 0; $i <@array; $i++) { if($array[$i] =~ /^Customer\s : \sYes/) { for ($count = $i; $count >= 1; $count--) { if ($array[$count] =~ /ID\s*:\s*(.+)/ ) { $ID = $1; #PLACE WHERE THE ID GET EXTRACTED print "$ID \n"; for ($count = $i; $count >= 1; $count--) { if ($array[$count] =~ /Module:\s*(.+)/ ) { $MODULE_NAME = $1; print "$MODULE_NAME \n"; my $Mycell1 = $Sheet->Range($Sheet->Cells($ro +w, $col),$Sheet->Cells($row, $col+2)); $Mycell1->{Value}=["$ID","$MODULE_NAME","$Fil +e"]; $row++; goto breakingfunction; } } } } breakingfunction: } }
Im able to extract the ID but not the Module no..help out monks
In reply to Need Help in Array by rajkrishna89
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |