Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

awk: cmd. line:1: (FILENAME=out.txt FNR=1) fatal: division by zero attempted

 
Saravanan Mrajan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
awk '$1 != "" {print Action $1 lastuser}' out.txt

where Action = getting the attribute of the files in the $1 fields.

out.txt file contins the below:
test1.html
Testpage.html

But while executing this i am getting the error as

awk: cmd. line:1: (FILENAME=out.txt FNR=1) fatal: division by zero attempted


 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11914
209
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's your definition for the Action function? Without that it is not really possible to think of what the problem might be. My guess is that Action has the ability to calculate file sizes in human terms (converting to Kb, Mb etc) and is not handling zero sized files correctly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic