0 Replies - 5941 Views - Last Post: 13 October 2013 - 01:41 AM

#1 raghupise  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-October 13

Pattern seacrh in Perl

Posted 13 October 2013 - 01:41 AM

Hi All,

I have been trying to search a pattern called "Group name" starts with X(ex: XCT08L1) under List Name.

Please find the code snippet.

#!/usr/local/bin/perl

my $str = "";
open (FD, "<", "PatternSearch.txt");
my @lines = <FD>;
close FD;

foreach (@lines) {
if(/LIST NAME:\t[A-Z]../) {
print STDOUT $_;
$str= $str.$_;
open (NW, ">", "RES.txt");
print NW $str;
close NW;
}
}





The above code is fetching Group Name in SearchPattern.txt.

I need to get List Name, Group Name (starts with X )and its Trasactions into another file.

The attachment shows "List name", "Group Name" and "Transactions" detail.

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Page 1 of 1