原帖由 userwuyou 于 2010-1-8 09:48 发表
请问楼主,这个软件和string(也是文本处理工具,猫似用法和这个一样) 有什么区别吗?
另外,问一下,这么复杂的东东,我们为什么不用edit.exe?
原帖由 lianjiang 于 2010-1-12 10:44 发表
谁把这个帖子研究透了,awk的使用应就无敌了。
awk gawk文章收集
http://www.cn-dos.net/forum/viewthread.php?tid=24225&fpage=1&highlight=
原帖由 dos时代菜鸟 于 2010-1-12 10:55 发表
看一楼 学习资料 就是这些东西。呵呵
但,对于dos下,还是需要不断摸索,总结经验。
比如:
比如:
echo.|awk '{print (2+3)*5}' 这样的句子就执行不了,而换成 echo.|awk '{print (2+3)/(1/5)}' 就能执行了。
原帖由 lianjiang 于 2010-1-12 11:15 发表
没注意一楼就有了那些资料。 有那些东西,也就全了。
剩下的就是实践了。
不同版本在命令格式上有差别,这是正常的。
这只有在实践中摸索总结了。
我用的版本,执行echo.|awk '{print (2+3)*5}' 是没问 ...
86.97 KB, 下载次数: 656, 下载积分: 无忧币 -2
dos版gawk
原帖由 oym2007 于 2010-1-12 16:25 发表
学习了的确好用,谢谢
awk '/Key/ {print $2}' ghststat.txt|awk '/1:/ {p=$1} END {print p}|nset bakp=$1 一句就能找到最后盘符
原帖由 oym2007 于 2010-1-12 16:25 发表
学习了的确好用,谢谢
awk '/Key/ {print $2}' ghststat.txt|awk '/1:/ {p=$1} END {print p}|nset bakp=$1 一句就能找到最后盘符
原帖由 快雪时晴 于 2010-1-12 19:29 发表
gawk官网下只有src,没编译器编译
http://www.gnu.org/software/gawk/gawk.html
另外
http://gnuwin32.sourceforge.net/packages/gawk.htm
只能用于WIN95以上
是否DOS下的必须自己编译?TC2能编译吗?
原帖由 快雪时晴 于 2010-1-12 19:29 发表
gawk官网下只有src,没编译器编译
http://www.gnu.org/software/gawk/gawk.html
另外
http://gnuwin32.sourceforge.net/packages/gawk.htm
只能用于WIN95以上
是否DOS下的必须自己编译?TC2能编译吗?
R:\>type 1.txt
Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
Usage: awk [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 exec=file --exec=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 use-lc-numeric --use-lc-numeric
-W version --version
To report bugs, see node `Bugs' in `gawk.info', which is
section `Reporting Problems and Bugs' in the printed version.
gawk is a pattern scanning and processing language.
By default it reads standard input and writes standard output.
Examples:
gawk '{ sum += $1 }; END { print sum }' file
gawk -F: '{ print $1 }' /etc/passwd
hello,world===============
Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
a a
A A
Usage: awk [POSIX or GNU style options] [--] 'program' file ...
a a a
A A A
POSIX options: GNU long options:
-f progfile --file=progfile
-F fs --field-separator=fs
a a
A A
........
Examples:
a
A
gawk '{ sum += $1 }; END { print sum }' file
a
A
gawk -F: '{ print $1 }' /etc/passwd
a a
A A
the last is =A
原帖由 快雪时晴 于 2010-1-14 21:06 发表
R:\>echo 111.111.111.111 | awk --posix "/([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}
/"
buffer: .
buffer: .
buffer: .
buffer: .
buffer: .
buffer: .
buffer: .
buffer: .
buffer: .
111.111.11 ...
![]() 附件 2010-1-15 17:00 ![]() ![]() awk 利用ucdos 特显功能中的绘图功能实现 纯dos下立体感官按钮效果 虚拟软盘: ![]() ![]() 这下,dos下的菜单也可以像win了。 软盘中的 awk\m.bat 是批处理,m.awk 是awk的脚本。 批处理需要choice 的协助。 |
原帖由 lizhenduo 于 2010-1-18 16:50 发表
dos时代菜鸟
中校阁下:
我不想用通过 gdisk 获得的 disk1.txt,而用 ghost -dd 生成的 ghststat.txt,该怎样写批处理来获得最后分区和第一分区到变量(我是双硬盘),请帮忙写个现成的,谢谢啦.
还有,如果用磁盘扇 ...
原帖由 lizhenduo 于 2010-1-18 16:50 发表
dos时代菜鸟
中校阁下:
我不想用通过 gdisk 获得的 disk1.txt,而用 ghost -dd 生成的 ghststat.txt,该怎样写批处理来获得最后分区和第一分区到变量(我是双硬盘),请帮忙写个现成的,谢谢啦.
还有,如果用磁盘扇 ...
1.JPG (31.23 KB, 下载次数: 174)
原帖由 dos时代菜鸟 于 2010-3-11 15:28 发表
用 wbat+awk+nset 实现的 简单计算器
@echo off
set x=0
set n=0
:top
cls
call w.bat box @jsq.bat:menu
if errorlevel 100 goto end
set n=%x%
echo { print %x% }>jsq.awk
echo.|awk -f jsq.awk|n ...
原帖由 dos时代菜鸟 于 2010-3-30 14:15 发表
1、nset 在win2000 下同样可以用。
2、可以用 gawk 的print 生成一个包含 SET 命令的 CMD 脚本,然后运行该脚本。
原帖由 dos时代菜鸟 于 2010-3-30 15:05 发表
1 生成一个包含 命令 SET N=15 的脚本x.cmd
echo.|gawk '{print "set n="1+2+3+4+5}' >x.cmd
2 运行X.CMD
991 Bytes, 下载次数: 71, 下载积分: 无忧币 -2
欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/) | Powered by Discuz! X3.3 |