call started 00:00:00, call ended 00:00:00, total modem active time 00:00:00 #### Modem Line 0/$i : total modem active time 00:00:00 #### #!/usr/sbin/perl -w # Program for modem pool log manipulation open(IN, $ARGV[0]) || die "cannot open $ARGV[0] for reading: $!"; open(OUT, ">$ARGV[1]") || die "cannot create $ARGV[1]: $!"; $i=0; while(){ if(/^call started/){ print OUT s/^call.*total/Modem Line 0\/$i : / ."\n"; $i++; } } close(IN); close(OUT);