The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ERROR: more than one instance of overloaded function "vprintf" has "C" linkage donatoll HP-UX 0 10-14-2008 06:35 AM
XIO: fatal IO error 232 (Connection reset by peer) on X server "192.168.1.239:0.0" grimanda HP-UX 3 01-31-2008 11:33 AM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
"syntax error at line 21 :'done' unexpected." error message" ibroxy Shell Programming and Scripting 3 08-08-2007 07:45 AM
Help! "Bus error" and "CPU Panic" box wont boot hcclnoodles SUN Solaris 3 10-05-2006 05:38 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-10-2009
justbow justbow is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 40
Question 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.. ^^
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:05 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0