 |
|
Home:
Perl Programming Help:
Beginner:
Re: [Laurent_R] A file parsing and 2D array/matrix problem.:
Edit Log
|
|

rushadrena
Novice
Sep 11, 2012, 1:14 PM
Views: 1409
|
|
Re: [Laurent_R] A file parsing and 2D array/matrix problem.
|
|
|
Laurent, I implemented the corrections suggested, and now there are 45 combined matrices generated ((9+8+7+....1). But the combined matrices are not getting correctly represented,
#########################./a/irrev_rev_revdup#######################Processing file: ./a/irrev_rev_revdup prod-> 1 2 3 4 5 6 7 8 9 10 1 - - - - - - - - - 1 2 - - 1 - 1 - - 1 - - 3 - - 1 1 - - 1 1 1 - 4 - - - - - - - - - - 5 - - 1 - - - - - 1 - 6 - - - - - - 1 - - - 7 - 1 1 - - 1 - 1 - - 8 - - - - - - - - - - 9 - - 1 - - - - 1 - 1 10 1 - - - - - - - 1 - ^ | substrate #########################./d/irrev_rev_revdup######################Processing file: ./d/irrev_rev_revdup prod-> 1 2 3 4 5 6 7 8 9 10 1 - - - - 1 - - - - 1 2 - - 1 - 1 - - 1 - - 3 - - 1 1 1 - 1 1 1 - 4 - - - - - - - - - - 5 - - 1 - 1 - - - 1 - 6 - - - 1 1 - 1 1 - - 7 - 1 1 - - 1 - 1 - - 8 - - - - - - - - - - 9 - - 1 - - - - 1 - 1 10 1 - - - - - - - 1 - Now the combined matrix of both is here and its incorrect(It should be displaying "Processing ./a and ./b" rather than "Processing ./a and ./d") Processing ./a and ./d prod-> 1 2 3 4 5 6 7 8 9 10 1 1 - 1 - - - - 1 - 1 2 1 1 1 - 1 - 1 1 - - 3 1 1 1 1 - - 1 1 1 - 4 - - - - - - - - - - 5 1 1 1 1 - - - - 1 - 6 - 1 - - - - 1 - - - 7 - 1 1 - - 1 1 1 - - 8 - - - - - - - - - - 9 1 - 1 - - - - 1 - 1 10 1 - - - - - - - 1 - ^ | substrate The above combined matrix should be for these two ("a" and "b" rather than "a" & "d"):-
#########################./a/irrev_rev_revdup######################Processing file: ./a/irrev_rev_revdup prod-> 1 2 3 4 5 6 7 8 9 10 1 - - - - - - - - - 1 2 - - 1 - 1 - - 1 - - 3 - - 1 1 - - 1 1 1 - 4 - - - - - - - - - - 5 - - 1 - - - - - 1 - 6 - - - - - - 1 - - - 7 - 1 1 - - 1 - 1 - - 8 - - - - - - - - - - 9 - - 1 - - - - 1 - 1 10 1 - - - - - - - 1 - ^ | substrate #########################./b/irrev_rev_revdup#####################Processing file: ./b/irrev_rev_revdup prod-> 1 2 3 4 5 6 7 8 9 10 1 1 - 1 - - - - 1 - - 2 1 1 - - 1 - 1 - - - 3 1 1 1 1 - - 1 1 1 - 4 - - - - - - - - - - 5 1 1 1 1 - - - - 1 - 6 - 1 - - - - 1 - - - 7 - 1 - - - 1 1 - - - 8 - - - - - - - - - - 9 1 - 1 - - - - 1 - - 10 1 - - - - - - - 1 - Similarly none of the 45 matrices are getting displayed with proper name combinations. Relevant code for displaying combination names:-
for my $i (0 .. $#dirs) { for my $j ($i+1 .. $#dirs) { print "Processing $dirs[$i] and $dirs[$j]\n"; my %data = combine($matrix[$i], $matrix[$j]); process(\@spr_prod, \@spr_substrate, %data); } } EDIT***** :- It would be really helpful if each of the concatenated matrices are printed after the two matrices from which it has been combined.
(This post was edited by rushadrena on Sep 11, 2012, 10:13 PM)
|
|
|
Edit Log:
|
|
Post edited by rushadrena
(Novice) on Sep 11, 2012, 1:18 PM
|
|
Post edited by rushadrena
(Novice) on Sep 11, 2012, 10:13 PM
|
|
|  |