note
blue_cowdawg
<ul><ul><i>
What I want to generate is this. (I also need to keep the row descriptors : run1, run2 etc)
</i></ul></ul>
<p>
There are many ways to skin this cat and the cat isn't happy about it.
<code>
#!/usr/bin/perl -w
use strict;
while (my $line=<DATA>){
chomp $line;
my($run,@sw)=split(/[\s]+/,$line);
my @switches=();
$switches[$_] = 0 foreach (0..5); # initialize switch array
$switches[$_ -1]=1 foreach (@sw);
printf "%s %s\n",$run,join(" ",@switches);
}
exit(0);
__END__
run1 2 4
run2 1 6
run3 1
run4 1 3
run5 2 5
</code>
</p>
<div class="pmsig"><div class="pmsig-72516">
<hr>
<font size="-2">
Peter L. Berghold -- Unix Professional<br>
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg<br>
</font>
</div></div>
1030134
1030134