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

How to count no. of lines in a file?

by ashok (Sexton)
on Dec 01, 2000 at 11:05 UTC ( [id://44307]=perlquestion: print w/replies, xml ) Need Help??

ashok has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have used like this to count no. of lines in a file on unix. $nl = `cat $filename | wc -l` It works fine. But one of the files having a blank in it's path like this. j:/org/temp/Program Files/source/myfirst.cpp Cat fails in this case because there is a blank between Program and Files in the directory name. How to solve this without changing the directory.? I have lready an array stored with file names along with its' path. When I have unzipped a .zip file it had created all the directories itself and stored the files like that. Thanks Ashok

Originally posted as a Categorized Question.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-03-28 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found