Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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.


Comment on Re: How to read only limited number of files from a Directory
Download Code

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 browsing the Monastery: (8)
As of 2015-07-05 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls