`
卫生委员的老公
  • 浏览: 8922 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论
文章列表

hbase filter

    博客分类:
  • perl
new ValueFilter(   CompareOp.LESS,   new BinaryComparator(Bytes.toBytes("a")) ); new QualifierFilter(   CompareOp.NOT_EQUAL,   new BinaryPrefixComparator(Bytes.toBytes("Column")) ); new RowFilter(   CompareOp.EQUAL,   new SubstringComparator("KEY1") ); new RowFilte ...
1.用shell求出从1至100的累加和 echo |awk '{for (i=1;i<=100;i=i+1) a=a+i} { print a}' 2.输出1到1000中能被7正常的数到/home/johnny中,并在屏幕中输出这些数之和! #!/bin/sh sum=0 for a in `seq 1 1000` do      if [ `expr $a % 7` -ne 0 ]      then           continue      fi      echo $a>>/home/johnny/print      sum=`expr $sum + $a ...

grep命令大练习

    博客分类:
  • perl
grep命令练习 文件:datafile Steve Blenheim:238-923-7366:95 Latham Lane, Easton, PA 83755:11/12/56:20300 Betty Boop:245-836-8357:635 Cutesy Lane, Hollywood, CA 91464:6/23/23:14500 Igor Chevsky:385-375-8395:3567 Populus Place, Caldwell, NJ 23875:6/18/68:23400Norma Corder:397-857-2735:74 Pine Street, Dearborn, ...
#!/usr/bin/perl use warnings; use strict; use DBI; my @array = ( 'a', 'b', 'c', 'a', 'd', 1, 2, 5, 1, 5 ); my %saw; my @out=grep(!$saw{$_}++,@array); print "@out\n";
如下文本: 12 23 34 45 56 67 想要得到的结果: 1223 3445 5667 1 perl -pe "chomp if $.%2" file 2 perl -pe "chomp; $_.=<>" file 3 perl -lpe "$\=--$|?$,:$/" file 第一种解释比较好理解,奇数行chomp去掉“\n”; 第二种所有行去去掉换行符,通过连接符“.”连接读入的下一行“<>”; 第三种是最神奇的 $| 默认是为0,通过--$|实现1与0相互跳转 $, 默认是空字符串 $ ...

Perl取得系统日期

    博客分类:
  • perl
($sec,$min,$hour,$mday,$mon,$year)=localtime(time); $mon++; $mon="0$mon" if ($mon<10); $mday="0$mday" if ($mday<10); $year+=1900; print "$year-$mon-$mday";

perl shift

    博客分类:
  • perl
use strict; use warnings; use utf8; my @city = ("tokyo", "osaka"); print "array-->:\n"; for (my $i = 0; $i <= $#city; $i++){     print "$city[$i]\n"; } my $val = shift(@city); print "\nget-->:\n"; print "$val\n"; print "th ...
Global site tag (gtag.js) - Google Analytics