Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 wandering the Monastery: (5)
As of 2017-08-22 10:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (333 votes). Check out past polls.

    Notices?