Results for "Print"

Wire posts

  • Count the number of occurrence of pattern in a file using Perl. perl -e '$_ = <>; print scalar ( () = m/needle/g ), "\n"' #Perl #Perloneliner #Count #Occurrence

    3630 days ago

  • Search a PATTERN in a file and print the line. perl -ne '/PATTERN/ && print' fileName #Perl #Pattern #Print #Search #Line

    3528 days ago

  • Print the PYTHONPATH python -c "import sys; print sys.path" #Pythonpath #Linux

    3474 days ago

  • Multi fasta to single fasta files $ perl -ne 'if (/^>(\S+)/) { close OUT; open OUT, ">$1.fasta" } print OUT' genome.fasta #Multi-fasta #fasta #multi #genome #files

    1153 days ago

  • Print all possible 2 combination of words ( ATGC): $letter = join',','A','T','G','C'; @abc=glob "{$letter}{$letter}"; foreach (@abc) { print "$_\n"; } #Perl #PerlTrick #TipsOftheDay

    3237 days ago

  • Sort FASTA sequence by length: cat f1.fasta| awk '{if($0 ~ /^>/){printf "%st", $0}else{print length($0)"t"$0}}'| sort -k2n,2| awk '{print $1"n"$3}' > sequence.fasta #Sort #Fasta #Trick #Onliner

    3202 days ago

  • Extract sequences by their ID from a fasta file. perl -ne 'if(/^>(\S+)/){$c=$i{$1}}$c?print:chomp;$i{$_}=1 if @ARGV' ids.txt sample1.fa #Extract #Sequences #IDs #Fasta #Perl #Trick #Oneliner

    3175 days ago

  • Print all the values beetween a pattern "abc" > awk '/abc/{flag=1;next}/mno/{flag=0}flag' file #awk #print #range #pattern

    3023 days ago

  • Print all the values between 15 to 17. perl -ne 'print if 15 .. 17' file #Perl #PerlTrick #Range

    3023 days ago

  • Print all text after a matching string perl -ne "print unless 1 .. m(String)" #Perl #OneLiner #String #Perl #Trick

    2989 days ago