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: Re: [Laurent_R] A file parsing and 2D array/matrix problem.: Edit Log



rushadrena
Novice

Sep 8, 2012, 1:32 PM


Views: 4835
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.

Code
1->1 
1->2
1->3
1->4
.....
2->1
2->2
......


The debug mode outputs ::-

Code
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)


Edit Log:
Post edited by rushadrena (Novice) on Sep 8, 2012, 1:33 PM


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

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