10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there, I am trying to select a number of lines based on the lat. lon columns in a file but my awk code gives me empty result.
Here is my file:
20100213 102212 33.1185 39.4078 2.9
20100214 141753 33.1058 39.9068 2.9
20100218 115828 33.1907 39.3575 2.9
20100225 220001 33.1932 39.9448... (10 Replies)
Discussion started by: johankor
10 Replies
2. Shell Programming and Scripting
file1:
maximum_delay time: 102.794 ms
maximum_delay time: 92.977 ms
maximum_delay time: 98.895 ms
maximum_delay time: 96.891 ms
maximum_delay time: 86.966 ms
maximum_delay time: 95.91 ms
maximum_delay time: 98.921 ms
maximum_delay time: 89.881 ms
maximum_delay time: 92.931 ms... (1 Reply)
Discussion started by: yanglei_fage
1 Replies
3. Shell Programming and Scripting
echo $line | awk -F, "BEGIN {if(NF==10) && /'"${MONTH}"' '"${DAY}"' '"${TIMEH}:"'/,0 {print $10"-"$4} else {print $13"-"$4}}"
if the fields in the line is equal to 10, print the values of this specified fields "$10 and $4".
if the fields in the line is anything but 10, print the values of... (5 Replies)
Discussion started by: SkySmart
5 Replies
4. Shell Programming and Scripting
I have a file
and if I'm doing following action on that file it's coming up correctly
awk -F"," '/DATA_TYPE/ { cnt += $3 } END { print " DATA_TYPE count=" cnt}' inter
DATA_TYPE count=19593131
now if I'm changing same AWK, so that now it can accept variable, then it's somehow not working.... (3 Replies)
Discussion started by: manas_ranjan
3 Replies
5. Shell Programming and Scripting
echo "abc:bcd" |awk '{split($0,b,":");print "b" is good }'
I want to "bcd" is good , anything is wrong with my, please don't change my thought with split, I just want to know what's wrong :o (1 Reply)
Discussion started by: yanglei_fage
1 Replies
6. Shell Programming and Scripting
ZSCORE=$(awk "BEGIN {if($STDEVIATE>0) {print ZSCORER=$(awk "BEGIN{print (${ALL} - ${AVERAGE}) / ${STDEVIATE}}")}else print "0"}")
awk: fatal: division by zero attempted
awk: BEGIN {if(0==0) {print ZSCORER=}else print 0}
awk: ^ syntax error
ALL=9
STDEVIATE=0... (2 Replies)
Discussion started by: SkySmart
2 Replies
7. Shell Programming and Scripting
Hi there,
what is wrong with this?
grep ">>" alarms_temp | awk '{print substr($5, 2), $7}' | read var1 var2
echo "$var1"
echo "$var2"
Both variable are empty, but if i run:
grep ">>" alarms_temp | awk '{print substr($5, 2), $7}'
I have:
0 9
as a result. (2 Replies)
Discussion started by: marimovo
2 Replies
8. Shell Programming and Scripting
Please let me know if I can use -F option and - V in a single awk statment. I want to import some comma separated shell variables using -F option and defining some static variables inside awk using -v option. (2 Replies)
Discussion started by: kalee
2 Replies
9. UNIX for Dummies Questions & Answers
hi champs,
i have a strange problem,
let ,
i have a array1, whose 1st character is ${array1}=h
let i want to search test.txt by awk/grep where the 1st character is the ${array1}....
if i am seraching by awk/grep by using variable..it return no rows from test.txt...
awk -v find=${array1}... (2 Replies)
Discussion started by: manas_ranjan
2 Replies
10. UNIX for Advanced & Expert Users
hi 2 all,
I'm trying 2 print " ' " in an awk statement but the sign deosn't show.
The only way I came with is 2 declare the ' as a variable and call that variable.
I'm trying 2 do:
awk '{printf("insert into ba_memo_01 values ('%s');",$1)}'
and get the output:
insert into ba_memo_01 values... (7 Replies)
Discussion started by: baraka
7 Replies