Giter Club home page Giter Club logo

perlonelinecn's Introduction

Perl 单行中文版

主要内容

日积月累

1、 转php的序列化格式到json: echo 'O:8:"stdClass":4:{s:7:"has_alt";b:0;s:8:"has_ctrl";b:1;s:9:"has_shift";b:0;s:8:"key_code";i:192;}'|perl -lpe 's#.*{#{#;s#s:\d+:"([^"]+)";[bi]:([^;]+);#\1 \2;#g;'

结果:

{
 has_alt 0;
 has_ctrl 1;
 has_shift 0;key_code 192;
}

2、perl oneline统计源码行数,去除行式注释: lib目录下 pm文件行数

perl  -lne  '$a++  unless /^#/ and /\/\// and  /=/; END{print $a} ' `find lib/ -type f  -name "*.pm"` 

3、基因序列去重

读入基因id的建立一个散列,然后从genome.fasta找散列中存在的基因如果存在就打印出来并存储

perl -ne 'if(/^>(\S+)/){$c=$i{$1}}$c?print:chomp;$i{$1}=1 if @ARGV' ids.file genome.fasta > ids.fasta ids.file

来源

perlonelinecn's People

Contributors

bollwarm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.