Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2016-09-26 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (476 votes). Check out past polls.