in reply to Parse Azureus Log File
Does that help?local $\ = "\n"; # line feed at end of print while(<>) { if(/\bPeer: (\w):\s+(\d+\.\d+\.\d+\.\d+):\s*(\d+)/) { print $2; } }
n.b. I've foreseen some requirement changes so I'm capturing the letter ("L", "R") and the port number too.
Update: it looks to me like you edited your question to include the time too. Fixing:
local($\, $,) = ("\n", " "); while(<>) { if(/([\d:.]+).*?\bPeer: (\w):\s+(\d+\.\d+\.\d+\.\d+):\s*(\d+)/) { print $1, $3; } }
|
|---|