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

Re: How to read only limited number of files from a Directory

by gurpreetsingh13 (Scribe)
on Jun 20, 2013 at 08:02 UTC ( #1039914=note: print w/replies, xml ) Need Help??


in reply to How to read only limited number of files from a Directory

Use your unix utilities alongwith. Here is a simple one-liner if you need to read only .txt files
perl -e 'foreach(`ls /willows/dev/shree/*.txt|head -500`){print `cat $ +_`;}'>>newfile.txt
That's just a simple code for concatenation.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039914]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2017-02-23 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (351 votes). Check out past polls.