
rushadrena
Novice
Sep 8, 2012, 1:32 PM
Views: 2855
|
|
Re: [Laurent_R] A file parsing and 2D array/matrix problem.
|
|
|
Hi Laurent. I dont want to list all the files in each of the ten directories. "list" is actually the name of the file. "list" is the only file I'm concerned about (the file "list" resides in each of the ten directories). The code will select first directory and then takes its "list" file,generate matrix and concatenate it with the "list" file generated matrix of second directory. Pairwise matrices ,that is.
1->1 1->2 1->3 1->4 ..... 2->1 2->2 ...... The debug mode outputs ::-
main::(code2.pl:26): my $path = '.'; # (current directory - '.') or path to data files DB<1> n main::(code2.pl:27): my @file = qw($dirs[$i]/list $dirs[$j]/list); DB<1> n main::(code2.pl:29): for my $file ( @file ) { DB<1> n main::(code2.pl:30): my %data; DB<1> n main::(code2.pl:31): my @substrate; DB<1> n main::(code2.pl:33): open my $fh, "<", "$file" main::(code2.pl:34): or die "Unable to open $file for reading. $!"; DB<1> print @dirs ../xla./mgp./oaa./acs./spu./mdo./ssc./dre./xtr./gga DB<2> print $dirs[1] ./xla
(This post was edited by rushadrena on Sep 8, 2012, 1:33 PM)
|