中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
<   <<   [1] [2] [3]  >>   >
作者:
标题: 高手们帮忙优化一下代码 上一主题 | 下一主题
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 16 楼』:  





2008-9-14 21:26
查看资料  发短消息 网志   编辑帖子  回复  引用回复
dragonamd
中级用户





积分 209
发帖 100
注册 2008-8-1
状态 离线
『第 17 楼』:  

和批处理放一起使用不了,。这个还没用过,具体怎么使用,能教一下吗


2008-9-14 21:45
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 18 楼』:  

还没用过如何知道和批处理放一起使用不了? 先看看帮助吧: gawk --help
Usage: gawk [POSIX or GNU style options] -f progfile [--] file ... Usage: gawk [POSIX or GNU style options] [--] "program" file ... POSIX options: GNU long options: -f progfile --file=progfile -F fs --field-separator=fs -v var=val --assign=var=val -m[fr] val -W compat --compat -W copyleft --copyleft -W copyright --copyright -W dump-variables[=file] --dump-variables[=file] -W gen-po --gen-po -W help --help -W lint[=fatal] --lint[=fatal] -W lint-old --lint-old -W non-decimal-data --non-decimal-data -W profile[=file] --profile[=file] -W posix --posix -W re-interval --re-interval -W source=program-text --source=program-text -W traditional --traditional -W usage --usage -W version --version To report bugs, see node `Bugs' in `gawk.info', which is section `Reporting Problems and Bugs' in the printed version.




2008-9-14 21:53
查看资料  发短消息 网志   编辑帖子  回复  引用回复
dragonamd
中级用户





积分 209
发帖 100
注册 2008-8-1
状态 离线
『第 19 楼』:  

gawk "{for (i=1;i<=NF;i++) { if($i~/^5-[0-9]/){ split($i,a,/-/); if(a[2]>max) max=a[2]; }}} END{print max}" your_file 和gawk放一起使用不正常啊,。


2008-9-14 22:01
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
slore
铂金会员





积分 5212
发帖 2478
注册 2007-2-8
状态 离线
『第 20 楼』:  

VBS慢因为它排序了,你只要最大的。。。时间复杂度是1




S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
2008-9-14 23:11
查看资料  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 21 楼』:  

"不正常"的具体表现是?




2008-9-15 00:27
查看资料  发短消息 网志   编辑帖子  回复  引用回复
dragonamd
中级用户





积分 209
发帖 100
注册 2008-8-1
状态 离线
『第 22 楼』:  

谁能解决一下。 表现的错误是 gawk:cmd. line:2:fatal: cannot open file 'your_file for reading <no such file or directory>


2008-9-15 00:37
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
lxmxn
版主




积分 11386
发帖 4938
注册 2006-7-23
状态 离线
『第 23 楼』:  

gawk:cmd. line:2:fatal: cannot open file 'your_file for reading <no such file or directory>
你有 your_file 这个文件吗? 把 your_file 替换成你自己的数据文件!


2008-9-15 07:08
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
dragonamd
中级用户





积分 209
发帖 100
注册 2008-8-1
状态 离线
『第 24 楼』:  

根本用不了,。斑竹这代码你可以正常使用 ?


2008-9-15 10:01
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 25 楼』:  

“根本用不了”的具体表现又是什么?




2008-9-15 11:18
查看资料  发短消息 网志   编辑帖子  回复  引用回复
dragonamd
中级用户





积分 209
发帖 100
注册 2008-8-1
状态 离线
『第 26 楼』:  

在这里其他的gawk可以用,就我的不能用


2008-9-15 12:48
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 27 楼』:  

报错信息贴出来看看?




2008-9-15 13:00
查看资料  发短消息 网志   编辑帖子  回复  引用回复
dragonamd
中级用户





积分 209
发帖 100
注册 2008-8-1
状态 离线
『第 28 楼』:  

你们运行正常,我运行不正常,郁闷


2008-9-16 02:00
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 29 楼』:  

运行不正常,总得有什么现象吧?




2008-9-16 10:01
查看资料  发短消息 网志   编辑帖子  回复  引用回复
dragonamd
中级用户





积分 209
发帖 100
注册 2008-8-1
状态 离线
『第 30 楼』:  

表现的错误是 gawk:cmd. line:2:fatal: cannot open file 'your_file for reading <no such file or directory> 还是这样,我不知道你们为什么能正常,


2008-9-16 20:59
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
<   <<   [1] [2] [3]  >>   >
请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: