I am stuck with this complicated problem.
I have a list
** LIST**
substrate[s]: 3649
product[s]: 3419 3648
substrate[s]: 3645
product[s]: 3647
substrate[s]: 3659
product[s]: 3647
substrate[s]: 3675
product[s]: 3674
substrate[s]: 3674
product[s]: 3490 3489
substrate[s]: 3489
product[s]: 3490
substrate[s]: 3490
product[s]: 3485
substrate[s]: 3485
product[s]: 3486
substrate[s]: 3486
product[s]: 3488
substrate[s]: 3488
product[s]: 3487
substrate[s]: 3487
product[s]: 3877
substrate[s]: 3877
product[s]: 3419
substrate[s]: 3182
product[s]: 1875
substrate[s]: 2809
product[s]: 3182
substrate[s]: 3186
product[s]: 2809
Now I have a superlist each of substrate & product as:-
**SUPERLIST_SUBSTRATE**
substrate[s]: 3649
substrate[s]: 3645
substrate[s]: 3659
substrate[s]: 3675
substrate[s]: 3674
substrate[s]: 3489
substrate[s]: 3490
substrate[s]: 3485
substrate[s]: 3486
substrate[s]: 3488
substrate[s]: 3487
substrate[s]: 3877
substrate[s]: 3182
substrate[s]: 2809
substrate[s]: 3186
substrate[s]: 3675
substrate[s]: 3492
substrate[s]: 3314
substrate[s]: 3006
substrate[s]: 3049
**SUPERLIST_PRODUCT**
product[s]: 3419
product[s]: 3648
product[s]: 3489
product[s]: 3647
product[s]: 3647
product[s]: 3674
product[s]: 3490
product[s]: 3490
product[s]: 3485
product[s]: 3486
product[s]: 3488
product[s]: 3487
product[s]: 3877
product[s]: 3419
product[s]: 1875
product[s]: 3182
product[s]: 2809
product[s]: 3492
product[s]: 3186
product[s]: 3492
product[s]: 1825
product[s]: 2543
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
substrates: 3649
products: 3419 3648
So 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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|