in reply to Two Column Data
#!/usr/bin/perl use warnings; use strict; open my $a, "<", "file1.txt" or die "Failed to open File : $!"; open my $b, "<", "file2.txt" or die "Failed to open File : $!"; open my $out, ">", "output.txt" or die "Failed to open File : $!"; chomp(my @file1=<$a>); chomp(my @file2=<$b>); close $a; close $b; my $max = @file1; my $min = 0; while ($min < $max) { print $min."\n"; print $out "$file1[$min] : $file2[$min]\n"; $min++; } close $out;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Two Column Data
by PilotinControl (Pilgrim) on May 11, 2015 at 19:31 UTC | |
by edimusrex (Monk) on May 11, 2015 at 20:04 UTC | |
by PilotinControl (Pilgrim) on May 11, 2015 at 22:11 UTC | |
by Laurent_R (Canon) on May 12, 2015 at 18:04 UTC |