in reply to Re^2: Read two files and print
in thread Read two files and print
open(FILE1, 'File1.txt'); open(FILE2, 'File2.txt'); while ($line = <FILE1>) { @lines=split(' ',$line); print $lines[1]; if($lines[1] != <FILE2>){ print "$line"; } }
In split use space as a delimiter, that will exactly splits the line.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Read two files and print
by GrandFather (Saint) on Feb 26, 2009 at 04:34 UTC |