由买买提看人间百态

topics

全部话题 - 话题: gawk
1 (共1页)
m******8
发帖数: 122
1
来自主题: Unix版 - [求助]安装gawk (转载)
【 以下文字转载自 Apple 讨论区 】
发信人: mandy628 (<<>>), 信区: Apple
标 题: [求助]安装gawk
发信站: BBS 未名空间站 (Tue Jun 10 13:30:46 2008)
想安装gawk,按照instruction里面的步骤.
./configure 没问题
make 没问题
make check 没问题
make install 有问题啦.
Error Message:
Making install in .
test -z "/usr/local/bin" || ./install-sh -c -d "/usr/local/bin"
./install-sh -c 'gawk' '/usr/local/bin/gawk'
cp: /usr/local/bin/_inst.37107_: Permission denied
make[2]: *** [install-binPROGRAMS] Error 1
make[1]: *** [install-am] Error 2
make: **
c*********p
发帖数: 3217
2
来自主题: Programming版 - 问个GAWK SHELL 问题.
gawk '$4~/2222/&&$5~/^66/ {x=x+$14}END{print"Total Value is :"x}' myfile1
gawk '$4~/2222/&&$5~/^66/ {x=x+$14}END{print"Total Value is :"x}' myfile2
gawk '$4~/2222/&&$5~/^66/ {x=x+$14}END{print"Total Value is :"x}' myfile3
如何将这三个TOTAL VALUE X 全部加起来再显示出来呢?
谢谢.
h*******s
发帖数: 11
3
来自主题: Programming版 - awk求救
I don't know about Cygwin, but gawk needs a flag:
gawk --posix "/a{2}/"
gawk --re-interval "/a{2}/"
W*****x
发帖数: 684
4
$ cd geoip-api-c-master
$ libtoolize
$ aclocal
$ autoconf
$ automake --add-missing
$./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
... 阅读全帖
l*l
发帖数: 225
5
来自主题: Unix版 - 使用 AWK 中的问题
I don't think awk can do with 199 arguments, no more than 100 normally.
But I test 300 and more with gawk, it do well.
So you can use gawk, but with no trick.
l*l
发帖数: 225
6
来自主题: Unix版 - why my "biff" doesn't work?
我给你个一次性解决方案, 我写了一个 shell demo 来替代 comsat, 免得
去搞系统, 在说不同 shell, 也不同, 也许你的喇叭关了呢. 以后问问题
尽量描述清楚, 这样大家都很方便的.
把下面的程序 copy 到一个文件里, 后台运行. 有信件会 bell 三十声
注意, 也许要修改的部分是 ' { print $5 } ', 不过我测试过基本 run anywhere.
#!/bin/sh
mailcheck(){
COUNT=1
while [ $COUNT -lt 30 ]
do
echo -ne \\a
sleep 1
COUNT=`expr $COUNT + 1`
done
}
MAILST=`ls -l /var/spool/mail/$USER | gawk '{print $5 }'`
LOOP1=1
while [ $LOOP1 -lt 100 ]
do
MAILED=`ls -l /var/spool/mail/$USER | gawk '{print $5 }'`
if [ $MAILED -gt $MAIL
c*****z
发帖数: 1211
7
cut is ok here, but awk is more powerful and can handle more complicated cas
es.
as to master a unix cmd tools is really not easy, to know how to use awk is
a better idea for me :)
anyway, gawk is available on almost all unix platform ( and i'm using gawk )
R***r
发帖数: 49
8
来自主题: Unix版 - 请教几个问题!!
1。用什么命令可以读取大文件某段数据?文件数据类型是floating
point。比如读图像raw文件从第100个byte到第200个byte?
2。在C-shell里调用gawk,能保存变量吗?不如gawk读出一个数据,
能保存成一个变量 a, 然后在下一行语句里用这个变量吗?
t******q
发帖数: 117
9
#!/bin/bas
#assum all programs are under your current dir. all executable
progset = `ls -l`
for prog in $progset;
do
./$prog&;
sleep 900;
ps aux | grep $prog | gawk '{print $2}' >> prog.log
ps aux | grep $prog | gawk '{print $2}' | xargs kill
done



a********h
发帖数: 245
10
来自主题: Biology版 - 求教:Deep sequencing的data convert
我觉得你这个像是tag count file (参考 GBS pipeline)。
自己用 linux shell commands will do that (假设你的文件是space delimit):
cat input.txt | nl | gawk -F' ' '{print ">"$1"_"$3"\n"$2}'
>1_2
ACAAACGACTCTCGGCAACGGTTGT
>2_1
ATATGAAGACAAGTAGTGCAGCTCGGAGACGGG
>3_1
ATAATAGAGGTTTTGCAAAACAAT
sequence ID will be unique if you only have one file and also include read
number information. For multiple files, just do: cat file1 file2 file2 | nl
| gawk -F' ' '{print ">"$1"_"$3"\n"$2}'
c***s
发帖数: 70028
11
美国选美小姐玛丽莎金恩
据香港媒体报道,美国选美小姐玛丽莎金恩( Melissa King)去年11月当选“美国德拉瓦州妙龄小姐”(Miss Delaware Teen USA)冠军,却被发现她因为缺钱曾经下海拍A片,无奈失去后冠,却吸引AV商向她招手,奉上一纸价值25万美元(约740万台币)的合约,并请她担任“情色大使”。
有网友在一个业余A片网站发现,其中一支A片的女主角不论长相或声音都很像玛丽莎金恩。Gawke网站报道说,影片中的女主角接受访问,自曝自己刚满18岁、参加过选美,并透露是因为缺钱才下海拍A片,直说:“这不是什么大秘密,但我没有特别对任何人说。”
玛丽莎金恩虽然否认是A片女主角,但选美协会发言人证实她已缴回后冠,由第二名的海莉萝拉( Hailey Lawler) 递补冠军。她虽然痛失“美国德拉瓦州妙龄小姐”冠军,但高名气吸引了情色人气网站YouPorn.com上门,除了奉上价值740万元台币的合约,还要颁发史上第一座“YouPorn”小姐后冠给她。
据八卦网站《TMZ》报导,获得“YouPorn”后冠之后,和许多选美小姐要巡回各地参加公益活动的任务类似,同样要巡回世界... 阅读全帖
C*******r
发帖数: 10345
12
估计lapdance不卖力,光要钱,没生意了。
First Unionized Strip Club Forced To Close Curtains In SF
SAN FRANCISCO -- Nearly two decades after they made the nation gawk by
forming its first unionized strip club, the dancers at San Francisco's Lusty
Lady are hanging up their thongs.
The employee-owned, co-op club will close in two weeks because it can no
longer afford its rent.
General manager Scott Farrell tells the San Francisco Chronicle http://bit.ly/171ba9J that while the workers own the club, they don't own... 阅读全帖
l****z
发帖数: 29846
13
Detroit's abandoned buildings draw tourists instead of developers
Detroit has seen an uptick in history buffs and photographers visiting its
ruins since its bankruptcy filing.
By Alana Semuels
December 25, 2013, 4:33 p.m.
DETROIT — He'd heard stories of ruin and blight, but that didn't prepare
Oliver Kearney for what he saw:
Prostitutes roaming the streets at 8 a.m., rubble-strewn parking lots
overrun with weeds, buildings taken over by bright pink graffiti, the
message scrawled on blackboards i... 阅读全帖
p***y
发帖数: 18037
14
看一下周日纽约地铁的大餐。看到那个menu就很饿呀,caviar, foie gras, filet mignon, 和 panna cotta, 都是我爱的。
======================================================================
http://www.nytimes.com/2011/05/04/dining/04train.html?_r=1&ref=
Aboard the L Train, Luncheon Is Served
By MELENA RYZIK
Published: May 3, 2011
The maître d'hôtel, who identified himself as C. K., steadied
diners' tables.
Yana Paskova for The New York Times
IN the era of pop-up restaurants and speakeasies, flash mobs and social
stunts, it... 阅读全帖
A**u
发帖数: 2458
15
来自主题: JobHunting版 - Eladian面试经过
他们怎么考bash?
sed gawk 语法?
难道他们的多线程不是pthread的?
n********e
发帖数: 41
16
来自主题: JobHunting版 - Leetcode的系统真是弱爆了
楼主 看到 你 isDiffByOne 函数就知道你必然要超时
Leetcode免费给你用 就别挑剔了。凡事要先从自身找问题
你那个测试不是大数据
真正的大数据在这里:
start = "nanny";
end = "aloud";
String[] d = {"ricky","grind","cubic","panic","lover","farce","gofer
","sales","flint","omens","lipid","briny","cloth","anted","slime","oaten","
harsh","touts","stoop","cabal","lazed","elton","skunk","nicer","pesky","
kusch","bused","kinda","tunis","enjoy","aches","prowl","babar","rooms","
burst","slush","pines","urine","pinky","bayed","mania","light","flare","
wares","wom... 阅读全帖
n******c
发帖数: 26
17
来自主题: NextGeneration版 - 关于俄亥俄大学04级学生车祸的捐款
If you are so curious, the following is the official report:
http://www.goerie.com/apps/pbcs.dll/article?AID=/20100902/OPINION01/309029996/-1/ETN
Published: September 02. 2010 12:01AM
Our view: Family of I-90 crash need answers, justice
Perhaps you've been involved in a fender-bender or wondered who chipped the
side of your car when it was parked in a lot. We've all gawked at accidents
along the highway, expressing concern about the victims as well as
impatience that traffic has slowed to a craw
s********y
发帖数: 1547
18
来自主题: NextGeneration版 - 此贴为车祸遇难的妈妈祈福
http://www.goerie.com/apps/pbcs.dll/article?AID=/20100902/OPINION01/309029996/-1/ETN
Published: September 02. 2010 12:01AM
Our view: Family of I-90 crash need answers, justice
Perhaps you've been involved in a fender-bender or wondered who chipped the
side of your car when it was parked in a lot. We've all gawked at accidents
along the highway, expressing concern about the victims as well as
impatience that traffic has slowed to a crawl.
Advertisement
Certainly we've read headlines like these: "
j*****5
发帖数: 5135
n******c
发帖数: 26
20
这里有详细的官方报道
http://www.goerie.com/apps/pbcs.dll/article?AID=/20100902/OPINION01/309029996/-1/ETN
Published: September 02. 2010 12:01AM
Our view: Family of I-90 crash need answers, justice
Perhaps you've been involved in a fender-bender or wondered who chipped the
side of your car when it was parked in a lot. We've all gawked at accidents
along the highway, expressing concern about the victims as well as
impatience that traffic has slowed to a crawl.
Advertisement
Certainly we've read headlines li
d*****j
发帖数: 1192
21
来自主题: NewJersey版 - 陈晓丹是真正的大美女 (转载)
Dirty old man gawking young pretty girl, not a pretty picture...
p***y
发帖数: 18037
22
那一个幸运的同学星期日吃了这顿L Train大餐?看到那个menu就很饿呀,caviar,
foie gras, filet mignon, 和 panna cotta, 都是我爱的。
======================================================================
http://www.nytimes.com/2011/05/04/dining/04train.html?_r=1&ref=
Aboard the L Train, Luncheon Is Served
By MELENA RYZIK
Published: May 3, 2011
The maître d'hôtel, who identified himself as C. K., steadied
diners' tables.
Yana Paskova for The New York Times
IN the era of pop-up restaurants and speakeasies, flash mobs and socia... 阅读全帖
d*****j
发帖数: 1192
23
Hey buddy, go back to your fashion board and have fun mastibating yourself
while gawking pictures of little luoli or da ma. Discussion here is beyond
comprehension of your little pea brain.
s********y
发帖数: 1547
24
http://www.goerie.com/apps/pbcs.dll/article?AID=/20100902/OPINION01/309029996/-1/ETN
Published: September 02. 2010 12:01AM
Our view: Family of I-90 crash need answers, justice
Perhaps you've been involved in a fender-bender or wondered who chipped the
side of your car when it was parked in a lot. We've all gawked at accidents
along the highway, expressing concern about the victims as well as
impatience that traffic has slowed to a crawl.
Advertisement
Certainly we've read headlines like these: "
p***e
发帖数: 1318
25
来自主题: SanFrancisco版 - Paul Ryan creamed by JB
yeah, I must have mistaken the guy who nervously
kept sipping water every minute. Was he Joe Biden?
or was he Jack Kennedy?
I could be wrong. So were Karl Rove, Bill Mahler, and hosts
and hosts of people who are literate, so were CNN, CBS,
so were 50% of polled independents who thought JB won the night
instead of 20 something % who thought the wild eye kid won.
For what it is worth, it is a debate not a mime. I wouldn't
use 感觉 to judge who is right and who is wrong. On
hosts of issues, JB pointe... 阅读全帖
s***y
发帖数: 3299
26
来自主题: WashingtonDC版 - 下周二上午看航天飞机在DC穿过。
有史以来第2次。
Space Shuttle Discovery to make final in-air appearance in 1,500-foot DC
flyover
http://www.engadget.com/2012/04/10/space-shuttle-discovery-wash
By Zach Honig posted Apr 10th 2012 1:17PM
Image
Folks lucky enough to be in the nation's capital next week will have one
final opportunity to gawk at Space Shuttle Discovery as the decommissioned
spacecraft makes its way to its final resting place in Washington D.C. The
shuttle is scheduled for a 1,500-foot flyover between 10 and 11 next Tuesda... 阅读全帖
c**i
发帖数: 6973
27
(1) BBC 利特海德, 记者来鸿:从天价大碗面看越南社会主义. BBC Chinese, Feb 18,
2011.
http://www.bbc.co.uk/zhongwen/simp
/world/2011/02/110218_fooc_vietnamnoodle.shtml
, which is translated from
Alastair Leithead, Communist Vietnam's $35 bowl of noodle soup. BBC, Jan 21,
2011.
http://news.bbc.co.uk/2/hi/programmes
/from_our_own_correspondent/9367223.stm
Note:
(a) gawp (vi; English dialect gawp to yawn, gape): "chiefly British GAWK"
All definitions are from www.m-w.com except otherwise identified.
(b) The report mentione... 阅读全帖
T*****o
发帖数: 68
28
来自主题: PhotoGear版 - Maui, Oahu三日行程求建议
你这种玩法根本不应该去夏威夷。夏威夷不是跑景点的地方,而是度假的地方,It is
about walking and gawking, eating and shopping, surfing and soaking up the
sun. 你这么紧赶紧跑的,既浪费你自己的时间,也让夏威夷失去它真正的价值。
如果你要摄影,去白沙公园及附近的新墨西哥州,如果犹他及阿里桑那都已经被你玩遍
了的话。不管是Oahu还是Maui,你要拍出一张让人眼睛一亮的照片是很难的,需要很深
的对摄影的理解才行。而白沙公园或者犹他等地则要容易很多。
只是two cents 而已,各人有各人的喜好,因为看到你的complain,所以就我自己的理
解给个两分钱。。。
E******y
发帖数: 1314
29
来自主题: PhotoGear版 - Maui, Oahu三日行程求建议
强Re, 旅游不是走穴赶场,到哪都一样,放松下来试着做个当地人,细细品味,就能体会到
各种惊喜~

is about walking and gawking, eating and shopping, surfing and soaking up
the sun. 你这么紧赶紧跑的,既浪费你自己的时间,也让夏威夷失去它真正的价值。
遍了的话。不管是Oahu还是Maui,你要拍出一张让人眼睛一亮的照片是很难的,需要很
深的对摄影的理解才行。而白沙公园或者犹他等地则要容易很多。
理解给个两分钱。。。
b*******n
发帖数: 1267
30
Stabbed hero dies as more than 20 people stroll past him in New York
By IKIMULISA LIVINGSTON, JOHN DOYLE and DAN MANGAN
Last Updated: 7:18 AM, April 25, 2010
Posted: 3:36 AM, April 24, 2010
A heroic homeless man, stabbed after saving a Queens woman from a knife-
wielding attacker, lay dying in a pool of blood for more than an hour as
nearly 25 people indifferently strolled past him, a shocking surveillance
video obtained by The Post reveals.
Some of the passers-by paused to stare at Hugo Alfredo... 阅读全帖
j****e
发帖数: 12067
31
【 以下文字转载自 Food 讨论区 】
发信人: patsy (patsy), 信区: Food
标 题: 地铁大餐 Aboard the L Train, Luncheon Is Se
发信站: BBS 未名空间站 (Wed May 4 21:07:17 2011, 美东)
看一下周日纽约地铁的大餐。看到那个menu就很饿呀,caviar, foie gras, filet mignon, 和 panna cotta, 都是我爱的。
======================================================================
http://www.nytimes.com/2011/05/04/dining/04train.html?_r=1&ref=
Aboard the L Train, Luncheon Is Served
By MELENA RYZIK
Published: May 3, 2011
The maître d'hôtel, who identified himself as C. K., s... 阅读全帖
c******l
发帖数: 36
32
oh, you need gawk, or how about perl with the same logic:
perl -F'\|' -alne '$k="$F[0]|$F[1]"; print if!$seen{$k}; $seen{$k}=1' file
j*a
发帖数: 14423
33
来自主题: Linux版 - 请问一个awk的问题
gawk '{if (/>/) print $1, substr($0, index($0, ">")); else print $0}'
你想个办法把index换成rindex
j*a
发帖数: 14423
34
来自主题: Linux版 - 请问一个awk的问题
gawk '{if (/>/) print $1, substr($0, match($0, "[^>]*$")); else print $0}' a
j*a
发帖数: 14423
35
来自主题: Linux版 - 请问一个awk的问题
gawk '{print $1, substr($0, match($0, "[^ >]*$"))}' a

a
g****g
发帖数: 1828
36
来自主题: Linux版 - awk
AWK是一种优良的文本处理工具,Linux及Unix环境中现有的功能最强大的数据处理引擎
之一。这种编程及数据操作语言(其名称得自于它的创始人 阿尔佛雷德·艾侯 、
Peter Weinberger 和 Brian Kernighan 姓氏的首个字母)的最大功能取决于一个人所
拥有的知识。 AWK 提供了极其强大的功能:可以进行正则表达式的匹配,样式装入、
流控制、数学运算符、进程控制语句甚至于内置的变量和函数。它具备了一个完整的语
言所应具有的几乎所有精美特性。实际上 AWK 的确拥有自己的语言: AWK 程序设计语
言, 三位创建者已将它正式定义为“样式扫描和处理语言”。它允许您创建简短的程
序,这些程序读取输入文件、为数据排序、处理数据、对输入执行计算以及生成报表,
还有无数其他的功能。gawk 是 AWK 的 GNU 版本。
最简单地说,AWK 是一种用于处理文本的编程语言工具。AWK 在很多方面类似于 Unix
shell 编程语言,尽管 AWK 具有完全属于其本身的语法。它的设计思想来源于
SNOBOL4 、sed 、Marc Rochkind设计的有效性语言、语言工具 y... 阅读全帖
x****s
发帖数: 921
d****d
发帖数: 2919
38
来自主题: Linux版 - Best Linux 4 Thinkpad
T410, NV的独立显卡。
装了下面这一堆东西,觉得够用了。
pacman -Q -e
acpid 2.0.10-2
acroread 9.4.2-1
alsa-oss 1.0.17-1
alsa-utils 1.0.24.2-1
archlinux-themes-slim 1.2-2
artwiz-fonts 1.3-6
aspell-en 7.1-1
attr 2.4.46-1
autoconf 2.68-1
automake 1.11.1-2
bash 4.2.010-1
binutils 2.21.1-1
bison 2.5-1
bzip2 1.0.6-1
cheese 3.0.1-2
chromium 12.0.742.112-1
coreutils 8.12-3
cryptsetup 1.3.1-2
dash 0.5.6.1-2
dcron 4.5-2
device-mapper 2.02.85-3
dhcpcd 5.2.12-1
diffutils 3.0-2
e2fsprogs 1.41.14-1
emacs 23.3-1
emesene 2.11.5-2
exo 0... 阅读全帖
j*****h
发帖数: 62
39
来自主题: Programming版 - unix shell一问
gawk '{ if ($2== "Car") {print $1+1, $2} else {print $0} } ' test.data
c*********p
发帖数: 3217
40
来自主题: Programming版 - 问个GAWK SHELL 问题.
自己顶下.?
h******a
发帖数: 198
41
来自主题: Unix版 - 使用 AWK 中的问题
try gawk,nawk,mawk.
One of them must works
l*l
发帖数: 225
42
来自主题: Unix版 - awk求助
gawk ' {
if ( $1 == $2 && FNR == 2) {
print "0"
}
if ( $1 != $2 && FNR == 2) {
print "1"
}
}'

s*****d
发帖数: 258
43
Got big data files, need to extract some of them, say delete every other line
what's the easiest way to achieve it?
I currently use this way:
$ gawk '(NR%2)==0' file >newfile
a********h
发帖数: 245
44
来自主题: Biology版 - 求教:Deep sequencing的data convert
补充一个:如果是tab delimit:
cat input.txt | nl | sed 's/ //g' | gawk -F'\t' '{print ">"$1"_"$3"\n"$2}'
q***m
发帖数: 9
45
来自主题: Statistics版 - 100GB的SAS数据一般怎么处理?
AWK速度很快,因为优化的很好。Windows上面也有gawk的,不过我没用过。
RMA不是你说的那个的,是针对于y=ax+b这种形式的参数估算方法,技术细节是:先求x
和y的Standard Deviation, a=SD(y)/(x), b=mean(y)-a*mean(x)
这种方法的好处是稳健性比较好,不过已经不属于常规的OLS了,你可以用采样的数据
做ols 然后跟这个RMA的方法做比较。
d*******y
发帖数: 349
46
来自主题: DataSciences版 - 如何合并两个数据文件 (转载)
这是我做的test。
test1
1|2|3
2|3|4
3|2|5
test2
1|a|f
2|b|g
join test1 and test2 using regular left outer join.
join -t"|" -a1 test1 test2 > test3
now, process test3
awk -F"|" 'BEGIN{for(i=1;i<=2;i++) testvar=testvar"|0"}NF<5 {print $0testvar;
next}{print $0}' test3 > test4
注意事项:
1.我的例子用的是pipe做为delimiter,习惯.
2.希望for loop要多长看你的两个文件column 差多少。
试试吧。不过几万列,不知道你的awk版本给不给力。如果不行试试gawk。
K**S
发帖数: 318
47
来自主题: _KiteRunner版 - 新加坡自助游傻瓜攻略
The following itineraries illustrate three ways to spend one day in
Singapore. They all assume you will start from and end your trip at your
lodgings. You can select the activities that sound interesting to you and
follow them in any order, including mixing and matching the morning/
afternoon/evening sections from the three different itineraries as you like.
All listed prices are in Singapore dollars. The estimates provided below do
not include food, drinks or the cost of transportation between ... 阅读全帖
1 (共1页)