We have two files
One fileALDH1A1
ITGA7
CHRNA1
PPP1R9A
ACTG1
SRGN
CD44
GRB7
and Second file
ALDH1A1 00001 NP_000680.2 ALDH1A1 00001 NP_000680.2 in vivo;yeast 2-hybrid 12081471,16189514
ITGA7 02761 NP_002197.1 CHRNA1 00007 NP_001034612.1 in vivo 10910772
PPP1R9A 16000 NP_060120.2 ACTG1 00017 NP_001605.1 in vitro;in vivo 9362513,12052877
SRGN 01513 NP_002718.2 CD44 00115 NP_000601.3 in vivo 9334256
GRB7 03311 NP_005301.2 ERBB2 01281 NP_004439.2 in vitro;in vivo 9079677
PAK1 03995 AAC24716.1 ERBB2 01281 NP_004439.2 in
And output shud beALDH1A1 NP_000680.2
ITGA7 NP_002197.1
CHRNA1 NP_001034612.1
PPP1R9A NP_060120.2
ACTG1 NP_001605.1
SRGN NP_002718.2
CD44 NP_000601.3
GRB7 NP_005301.2
#!/usr/bin/perl -w $j=1; open (FILE,"$ARGV[0]") or die; my @temp =<FILE>; close FILE; foreach $x(@temp) { chomp($x); $line = $1; $flag = 1; } open (FILE,"$ARGV[1]") or die; my @parse=<FILE>; close FILE; open(WRITE,">output.txt"); { if($flag==1){ if ($x==$parse[$0]) { print WRITE "$x $j\n $line\n";$j++;} } }
In reply to matching twof files and print the output by vis1982
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |