@files = glob "*.log"; $count = 1; foreach $file (@files) { next unless $file =~ /planetlab/; open FILE, ">", "/home/mj/ipAddresses$count.log" or die "Can't wri +te to file: $!"; print FILE "begin\n"; local($\, $,) = ("\n", " "); while(<>) { if(/([\d:.]+).*?\bReceived.*?\bBT_PIECE.*?\bdata.*?\bPeer: (\w +):\s+(\d+\.\d+\.\d+\.\d+):\s*(\d+)/) { print FILE $3; } } print FILE "end"; print "$file\n"; close FILE; $count++; }
In reply to Re^4: Log Parsing
by mattwortho
in thread Log Parsing
by mattwortho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |