#!/usr/bin/perl while( <> ) { s/[^\w ,.()\t-]+//g; print; } #### perl -pi.old -e 's/[^\w ,.()\t-]+//g' input_file