Only one loop is needed.
#!/bin/perl open(IN, "file1"); open(IN2, "file2"); open(OUT, "> output"); while ($str = <IN>) { chomp($str); $data = <IN2>; chomp($data); @box = split(/\s+/, $data); splice(@box, 1, 0, $str); print OUT (join(' ', @box) . "\n"); }
In reply to Re: read column in perl
by ikegami
in thread read column in perl
by dee00zee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |