By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

getting error when I m trying to feed 'awk' command in my perl script

P: 11
hello bytes friends,
I am trying to run simple perl script with linux command where I am using 'awk' command and my perl script is
------------------------------------------------
#!/usr/bin/perl -w

use strict;


while (my $line =<>) {
chomp $line;
my @list = split ('\t+',$line);
if ($list[0] == 9606 && $list[3] eq "BLAST_KEGG_DBLINKS_UniProt BLAST_UniProt_AC Ensembl_HGNC_UniProt_ID_(mapped_data_supplied_by_U niProt) Ensembl_UniProt_AC") {



print `zgrep ^"$list[0]\.$list[1]" protein.links.v9.0.txt.gz | sort -k3 | awk '($3>400){print}' | head -n100`;
}
}
----------------------------------------------------------
input file is
----------------------------------------------------------
9606 ENSP00000356489 AAO15524.1 Ensembl_protein_id
9606 ENSP00000329418 O15524 BLAST_KEGG_DBLINKS_UniProt BLAST_UniProt_AC Ensembl_HGNC_UniProt_ID_(mapped_data_supplied_by_U niProt) Ensembl_UniProt_AC
----------------------------------------------------------
in my perl script $3 signifies where score is bigger than 400 then they will print out and head -n100 means my output limit 100.

But I am getting error like this-
----------------------------------------------------------
Use of uninitialized value $3 in concatenation (.) or string at string_interaction.pl line 13, <> line 1.
----------------------------------------------------------

Can you please help me to figure out of this problem?

thank you in advance.
Pallab
May 31 '12 #1
Share this Question
Share on Google+
1 Reply


P: 11
Hello friends
I solved my problem. Thank you so much.
May 31 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.