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

Re: Parse txt file into array of array

by jwkrahn (Monsignor)
on Jun 06, 2013 at 10:31 UTC ( #1037434=note: print w/ replies, xml ) Need Help??


in reply to Parse txt file into array of array

open (A1, "<2 normaal.txt") or die "can't open"; my @MainArray; while (<A1>) { my $in = $_; chomp $in; push (@array1, split(//, $in)); }

Another way to do it:

open my $A1, '<', '2 normaal.txt' or die "can't open '2 normaal.txt' b +ecause: $!"; my @MainArray; while ( my $in = <$A1> ) { push @MainArray, [ $in =~ /[[:alpha:]]/g ]; }


Comment on Re: Parse txt file into array of array
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-09-03 00:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (34 votes), past polls