v15 has asked for the wisdom of the Perl Monks concerning the following question:
I want to write a script in perl where I can print out those lines in which column 7 is greater than 10. my code is as follows:chr10 180833 225933 1 1 0 1 0 16 chr10 181144 225933 1 1 0 2 0 13 chr10 181243 225933 1 1 0 4 0 32 chr10 181500 225933 1 1 0 5 0 34 chr10 196199 196457 1 1 0 1 0 31 chr10 226069 243850 1 1 0 1 0 25 chr10 226069 255828 1 1 0 32 0 37 chr10 255989 267134 1 1 0 24 0 33 chr10 255989 282777 1 1 0 13 0 38 chr10 267297 282777 1 1 0 33 0 38
while(<>){ chomp; my @s = split /\t/,$_; my $count = $s[6]; if($count > 10){ print $_,"\n"; } }
What i want to do is use Getopt::Long module and make a flag --unique so that I can feed any value to that flag let's say 2 or 4 or 10 etc and it prints the line fulfilling the condition. How can I do that?
Thanks Varun
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using Getopt::Long
by Corion (Patriarch) on Sep 27, 2016 at 19:43 UTC | |
by v15 (Sexton) on Sep 27, 2016 at 19:47 UTC | |
by Corion (Patriarch) on Sep 27, 2016 at 19:54 UTC | |
by GrandFather (Saint) on Sep 27, 2016 at 19:55 UTC | |
by v15 (Sexton) on Sep 27, 2016 at 20:04 UTC | |
|
Re: using Getopt::Long
by GotToBTru (Prior) on Sep 27, 2016 at 19:46 UTC |