CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Assigning arrays to columns in a file?

 



AndrewF
Novice

Jul 18, 2013, 4:31 PM

Post #1 of 1 (434 views)
Assigning arrays to columns in a file? Can't Post

Hello there, Ive been stuck trying to assign two different arrays I have to two different columns in a file. [/codeopen (ECFILE, 'PEC,CEC.txt');

my @reactant;
my @product;

while (<ECFILE>){

my @all = <ECFILE>;
push (@reactant, $all[0]);
push (@product, $all[1]);
print "@reactant\n";
print "@product\n";
}]

the file is formatted like so...
AA AA
AB AB
AC AC
AD AD
Any help? I know Im close to the answer but I've been looking at this for awhile and need another set of eyes to catch what I've missed. Thanks very much!

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives