
05-10-2009
|
|
Registered User
|
|
|
Join Date: Dec 2008
Posts: 40
|
|
error "awk: (FILENAME=- FNR=23) fatal: division by zero attempted"
Hi ,
I have file :
Quote:
16 0
27 0
26 0
44 0
28 0
23 0
187 0
14 1
98 1
41 0
47 0
61 0
78 2
40 0
105 1
175 1
175 0
67 0
118 0
30 0
149 1
210 1
0 0
0 0
112 0
|
after i run this command :
Quote:
|
cat file | awk '{print $3" ,"100*($3/($3+$4))" ,"}'
|
there are error
Quote:
16 ,100 ,
27 ,100 ,
26 ,100 ,
44 ,100 ,
28 ,100 ,
23 ,100 ,
187 ,100 ,
14 ,93.3333 ,
98 ,98.9899 ,
41 ,100 ,
47 ,100 ,
61 ,100 ,
78 ,97.5 ,
40 ,100 ,
105 ,99.0566 ,
175 ,99.4318 ,
175 ,100 ,
67 ,100 ,
118 ,100 ,
30 ,100 ,
149 ,99.3333 ,
210 ,99.5261 ,
awk: (FILENAME=- FNR=23) fatal: division by zero attempted
|
can we print blank line if output error ??
thanks.. ^^
|