Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Simple regexp question

by droog114 (Initiate)
on Mar 31, 2006 at 05:54 UTC ( [id://540373]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://540373]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-03-29 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found