Hey, all
I have been struggling with problem for quite a while, any hints of librating me from the fight will be highly appreciated.
first there is a file "pool", the first col is something with will be matched by some key
WorldComInc WorldCom, Inc.
second there is file "key_trace"...
Hi, all
suppose I have following txt file "people"
Tim US
Xue CHN
Will US
Tom US
Yong CHN
if I work with a sedscript as following:
/US$/ {
s//USA/
w us.origin_1
}
then following code works
sed -n -f sedscript people
However, its oneliner version as below doesn't
sed '/US$/ {s//USA/; w...
Hi, all
The data is like following:
############## data ####################
time name price
20050616 company2 32
19900112 company1 39
19980223 company2 44
20060523 company1 55
############# job to be done ################
the job is simple, find the starting...
Hi, all
I have been trying to find a way to pass parameters into regular expression, failed, so I am back.
for example, I have following two files:
# firstfile
USA US United_States_of_America
# secondfile
x company USA
US y Company
xyz United_States_of_America
what I want is to pass...
Hi, all
I get many keys to extract records in other files. However, following scripts doesn't spell out what I expected.
Both the keyfile and to be extracted files are tab dlimited.
# keys in three column
for keycol in 1 2 3
do
# creat a vector...
Dear all
I am sure this is a simple quesiton for most people visiting this forum.
the question in detail is as following:
A data file with unconstant NF, the fields I want to reserve is field 1 to field (NF-1), they should be printed out on the same row. for example
thank you for your kind...
Dear all
What follows is a simple awk program with a shell wrapper. The problem is sometimes it works fine and sometime it won't.
##########################################################
for ((i=1990;i<=2006;i++))
do
awk 'BEGIN{FS=OFS="\t"} {if ($2==m) print $1,$3,$4}' m=$i GI> tmpGI
awk...
Dear all,
I use following codes to join two tab delimited files and print out wanted columns. for both files, the key is at the 4th cols. the codes work for following two files, let me call them "wf1" and "wf2"
first the codes:
awk -F"\t" '{while((getline<"'wf2'")>0) f2[$4]=$4;OFS="\t"} {if...
Dear all:
I am new to awk and hope to know an efficient way to achieve following object:
suppose the dataset is as following:
a 40
b 10
c 10
c 20
b 20
c 30
a 30
c 20
what I want to do is
first to collect information on a
a 40
a 30
2nd, calculate a summary information...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.