A file parsing and 2D array/matrix problem.by zing (Beadle)
|on Aug 25, 2012 at 12:51 UTC||Need Help??|
zing has asked for the
wisdom of the Perl Monks concerning the following question:
I am stuck with this complicated problem. I have a list
Now I have a superlist each of substrate & product as:-
The superlist_product and superlist_substrate will encompass all the possible substrates & products in LIST. ie. substrate(LIST) is a subset of superlist_substrate and similarly for product(LIST). Now i want to create a SUPERARRAY as superlist_substrate(rows) X superlist_product(columns). Now parse the LIST for each substrate id one by one insert a "1" for each product id in the SUPERARRAY. For example consider first two lines of LIST
products: 3419 3648So for substrate id 3649 ,the row id=3649 will be selected from SUPERARRAY and a "1" will be inserted at column ids 3419 & 3648 of the SUPERARRAY. And so on for the entire LIST.Basically SUPERARRAY will be a matrix.