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

Re: perl

by Fastolfe (Vicar)
on Nov 10, 2000 at 00:45 UTC ( #40814=note: print w/ replies, xml ) Need Help??


in reply to perl

A one-liner that will do this:

perl -ne '$count++ unless /\S/; print "$count\n" if eof' <filename


Comment on Re: perl
Download Code
Re^2: perl
by Random_Walk (Parson) on Sep 03, 2004 at 07:49 UTC
    A slightly shorter version perl -pe '$c++ unless /\S/}{$_=$c' Cheers,
    Random.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2014-07-31 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls