in reply to Re^3: A complicated file parsing and 2D array/matrix problem.
in thread A file parsing and 2D array/matrix problem.
Hello Kenosis.
Now there's the last piece of puzzle. I have created 5 such matrices (with obviously same number of rows and column).
Now the problem is that I have to concatenate (OR logic operation) two such matrices,
INPUT = Two matrices A,B of same row and column saved in text files A.txt and B.txt
OUTPUT = A single matrix C ( Cij = Aij OR Bij )
I.e. an element of matrix will be one if either of the corresponding element of A or B is one.==============INPUT======= MAT - A 1875 2809 3182 3419 2809 - 1 1 - 3182 1 - - - 3186 1 1 - - 3485 - - - - 3486 - - - - MAT - B 1875 2809 3182 3419 2809 1 - - 1 3182 - - - - 3186 - 1 1 - 3485 - - - - 3486 - 1 - 1 ========== OUTPUT=========== MAT - C 1875 2809 3182 3419 2809 1 1 1 1 3182 1 - - - 3186 1 1 1 - 3485 - - - - 3486 - 1 - 1
In Section
Seekers of Perl Wisdom