Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
while (<FILE2>) { push @col, $_ =~ m/(\S+\s+\S+)/ #unless m/SN\b.*|generated\b.*|No\ +b.*|startpattern.*|endpattern.*/; } open(data, "<TRUE_OUTPUTS"); while(<data>) { $_ =~ s/^(\S\s+\S)/$1 $col[$i++]/; print OUT2 $_; }
thankssample input: 0 1 0 1 1 0 sample to attach: 0.85 0.20 0.65 0.50 0.23 0.48 output: 0 1 0.85 0.20 0 1 0.65 0.50 1 0 0.23 0.48
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: inserting array of data into text file
by dragonchild (Archbishop) on Jul 13, 2004 at 13:22 UTC | |
by Anonymous Monk on Jul 13, 2004 at 13:29 UTC | |
by dragonchild (Archbishop) on Jul 13, 2004 at 13:45 UTC | |
by bart (Canon) on Jul 14, 2004 at 00:51 UTC | |
by ysth (Canon) on Jul 14, 2004 at 01:26 UTC | |
by Anonymous Monk on Jul 13, 2004 at 13:45 UTC | |
by Anonymous Monk on Jul 13, 2004 at 14:00 UTC | |
by dragonchild (Archbishop) on Jul 13, 2004 at 14:13 UTC | |
|