http://qs1969.pair.com?node_id=540373


in reply to Re: Simple regexp question
in thread Simple regexp question

Hi, sorry for the lack of info, I am new at this. Anyways, my text file features the following set of lines at variable lengths # **************************** I basically just want to get rid of all #'s and *'s in the file.

Replies are listed 'Best First'.
Re^3: Simple regexp question
by ikegami (Patriarch) on Mar 31, 2006 at 07:21 UTC
    perl -pe "s/[#*]//g" infile > outfile
    or in-place:
    perl -i.bak -pe "s/[#*]//g" filename
    If you want to delete the entire line, then
    perl -pe "next if /[#*]/" infile > outfile
    or in-place:
    perl -i.bak -pe "next if /[#*]/" filename