Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Printing first and last line

by Old_Gray_Bear (Bishop)
on Aug 14, 2012 at 00:46 UTC ( #987243=note: print w/ replies, xml ) Need Help??


in reply to Printing first and last line

$ head -1 Sample_01.txt $ tail -1 Sample_01.txt
Sometimes the answer is to use the shell commands rather than try to recreate them in Perl. See Low Fat Linux for an example.

Update: Added link to head/tail documentation.

----
I Go Back to Sleep, Now.

OGB


Comment on Re: Printing first and last line
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2015-07-31 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (277 votes), past polls