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

Re: arrange output in columns

by hdb (Parson)
on Jun 18, 2013 at 13:19 UTC ( #1039562=note: print w/ replies, xml ) Need Help??


in reply to arrange output in columns

use strict; use warnings; my @result; my $count = 0; for (<"j*.txt">) { open my $fh, "<", $_ or die "Cannot open $_ $!\n"; while(<$fh>){ chomp; $result[$.-1][$count] = $_; } $count++; } for my $line (@result) { print join( ",", map { $_//"" } @$line ), "\n"; }


Comment on Re: arrange output in columns
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-08-29 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (276 votes), past polls