outputs (with your data)#! /usr/bin/perl open(FILE,"<file.txt"); my @lines=<FILE>; close(FILE); my $module; my $id; foreach my $line(@lines) { chomp($line); if($line=~ /Module.*/) { $line=~ /:\s*/;$module=$'; } if($line=~ /ID.*/) { $line=~ /:\s*/;$id=$'; } if($line=~ /Customer : yes/i) { print "$module and $id\n"; } }
1 and 001 3 and 003
In reply to Re: Need Help in Array
by ansh batra
in thread Need Help in Array
by rajkrishna89
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |