zing has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, I have this file(space separated)
___INPUT____ run1 2 4 run2 1 6 run3 1 run4 1 3 run5 2 5
The input file basically tells us the positions which are in on state for a device with 6 switches. Thus for example first row "2 4" means only 2nd and 4th switch are on.
What I want to generate is this. (I also need to keep the row descriptors : run1, run2 etc)
___OUTPUT___ run1 0 1 0 1 0 0 run2 1 0 0 0 0 1 run3 1 0 0 0 0 0 run4 1 0 1 0 0 0 run5 0 1 0 0 1 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: generating rows(matrix) based on file content
by blue_cowdawg (Monsignor) on Apr 23, 2013 at 13:16 UTC | |
|
Re: generating rows(matrix) based on file content
by choroba (Cardinal) on Apr 23, 2013 at 13:17 UTC | |
|
Re: generating rows(matrix) based on file content
by hdb (Monsignor) on Apr 23, 2013 at 13:33 UTC | |
by hdb (Monsignor) on Apr 23, 2013 at 20:41 UTC | |
|
Re: generating rows(matrix) based on file content
by LanX (Saint) on Apr 23, 2013 at 21:04 UTC | |
|
Re: generating rows(matrix) based on file content
by MidLifeXis (Monsignor) on Apr 23, 2013 at 13:12 UTC |