码迷,mamicode.com
首页 >  
搜索关键字:awk gsub sub split substr    ( 23444个结果
发布/订阅消息传送模型
1、发布/订阅模型概览 发布/订阅(publish-and-subscribe)模型通常被简写为pub/sub模型。在这个模型中,消息生产者成为发布者(publisher),而消息消费者则称为订阅者(subscribe)。在点对点模型中,是将消息发送到一个队列中,而发布/订阅模型则是将消息发布给一个...
分类:其他好文   时间:2014-07-22 22:50:57    阅读次数:4009
jquery checbox 全选,反选
<body> <input type="checkbox" id="ckAll" />check all<br /> <input type="checkbox" name="sub" />1<br /> <input type="checkbox" name="sub"/>2<br /> <input type="checkbox" name="sub"/>3<br /> <input t...
分类:Web程序   时间:2014-07-22 09:13:34    阅读次数:325
DSP 之原子与高性能设计(一) 用户态/内核态 原子原语
type __sync_fetch_and_add (type *ptr, type value, ...) type __sync_fetch_and_sub (type *ptr, type value, ...) type __sync_fetch_and_or (type *ptr, type value, ...) type __sync_fetch_and_and (type *...
分类:其他好文   时间:2014-07-22 09:00:07    阅读次数:163
substr()和substring()方法
substr()和substring()方法可用来从字符串中提取一个子串,并赋予另一个变量,或者用在表达式中。这两个方法返回的结果相同,都是子串,但它们需要的参数不同。substring()方法接受两个参数:子串的开始位置和子串中最后一个字符后面的字符位置。第二个参数是可选的,如果不包含它,则子串包...
分类:其他好文   时间:2014-07-21 08:27:35    阅读次数:511
awk命令的几个选项注释
awk字符串函数gsub(r,s)在整个$0中用s替代rgsub(r,s,t)在整个t中s替代rindex(s,t)返回s中字符串t的第一个位置match(s,r)测试s是否包含匹配r的字符串split(s,a,fs)在fs上将s分成序列asprint(fmt,exp)返回经fmt格式化后的expsub(r,s)用$0中最左边最长的字符串代替ssubstr(s,p)..
分类:其他好文   时间:2014-07-20 15:41:31    阅读次数:210
【文本处理】awk、sed使用 - 二
一些例子。1、显示gopher帐号所在行至最后一行。awk‘/^gopher/{row=NR;while(getline<"passwd"){++i;FS=":";if(i>=row){print$0}}}‘passwdgetline<"filename"若读取成功,则返回非0,当读文件完后,会返回0。awk-F:‘NR==FNR{if($1~/^gopher/){row=NR};next}{if(FNR>..
分类:其他好文   时间:2014-07-20 15:31:51    阅读次数:353
用shell本检查日志中是否有错,有错则发邮件
#!/bin/bash#初始化环境变量source.bash_profile#日志名中的固有日期格式f_name=`date+%Y%m%d`#日志的路径及名称log_file=/backup/db/rman/log/rman$f_name-0401.logecho$log_file#统计日志文件行数#line_num=`wc-l$log_file|awk‘{print$1}‘`#echo$line_num#如果日志文件不存在..
分类:其他好文   时间:2014-07-20 10:18:28    阅读次数:304
定制iso系统
定制CentOS5.5精简的自动安装版1、安装制作发行版所需的基本软件包yum-yinstallcreaterepomkisofs2、生成安装系统所需的rpm文件列表awk‘/Installing/{print$2}‘install.log|sed‘s/^[0-9]*://g‘>/root/CentOS.list3、创建定制工作目录mkdir-p/mnt/cdrommkdir-p/data/OSmount/..
分类:其他好文   时间:2014-07-20 03:42:51    阅读次数:382
区间Dp 暴力枚举+动态规划 Hdu1081
F - 最大子矩形 Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is any ...
分类:其他好文   时间:2014-07-19 23:26:59    阅读次数:236
C++中如何split字符串(转)
#include #include #include using namespace std;int main(){ string s("Somewhere down the road"); istringstream iss(s); while (iss) ...
分类:编程语言   时间:2014-07-19 23:13:54    阅读次数:248
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!