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.
In reply to Re^3: Read two files and print
by velusamy
in thread Read two files and print
by sandy1028
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |