open (DIFFR, "/tmp/log.diff"); while () { $line=$_; #read first line chomp($line); if ($line =~ /ERROR/) { print CSVFILE "$line,"; } #### 2004.12.01 20:00:49.307 Agent.AgentLOG saveToSYS_AGENT_RUN_LOG() ourhost(10.10.52.36) ERROR: ********* memo == *** End Execution