Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Newbie: uses/limits of perl in editing files

by Sixtease (Friar)
on Nov 23, 2007 at 14:08 UTC ( [id://652567]=note: print w/replies, xml ) Need Help??


in reply to Newbie: uses/limits of perl in editing files

You can do this with pretty much any scripting / programming language (if it has input/output capabilities and is turing-complete). And Perl may be the most comfortable one for this.

The code to do something like you said could look like

perl -pe '/^REMARK/ and print "the line you want to add\n"' < input_file > output_file

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-18 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found