#!perl -n if(/RS/) { print } and example of use: C:\>script.pl acis_empx20_win32d_3400.log > acis_filtered.log