Salwrwr has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use Getopt::Std; open (my $newfile, ">", "C:/result.txt"); open (my $fh, "<", "C:/position.txt"); open (my $file, "<", "C:/platform.txt"); my @file_data = <$fh>; my @position = <$file>; close($fh); close($file); foreach my $line (@position) { my @line = split(/\t/,$line); my $start = $line[0]; foreach my $values(@file_data) { my @values = split(/\t/, $values); my $id = $values[0]; if ($start eq $id) { print $newfile $line[0],"\t",$line[2],"\t",$line[3],"\t",$values[0 +],"\t",$values[1],"\t",$values[2],"\n"; } } } print "DONE";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: match text files
by toolic (Bishop) on Jul 18, 2013 at 17:56 UTC | |
|
Re: match text files
by mtmcc (Hermit) on Jul 18, 2013 at 18:03 UTC | |
|
Re: match text files
by Anonymous Monk on Jul 18, 2013 at 18:26 UTC | |
|
Re: match text files
by hdb (Monsignor) on Jul 18, 2013 at 18:17 UTC | |
|
Re: match text files
by rjt (Curate) on Jul 18, 2013 at 20:08 UTC |