Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Merging files, 1 line for every 10 (one-liner)

by BrowserUk (Pope)
on Sep 06, 2011 at 22:10 UTC ( #924474=note: print w/ replies, xml ) Need Help??


in reply to Merging files, 1 line for every 10

A one-liner:

perl -ple"printf q[%s], scalar <STDIN> unless $n++ % 10" file1 < file2

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Merging files, 1 line for every 10 (one-liner)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2014-12-29 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls